mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
[example] ray_cube_shadows: wrap push constant in a struct
We are aware of this issue, I don't know why the example doesn't fail on trunk though...
This commit is contained in:
parent
edbadd2b99
commit
62d4e82149
@ -33,7 +33,10 @@ var<uniform> uniforms: Uniforms;
|
||||
@group(0) @binding(1)
|
||||
var acc_struct: acceleration_structure;
|
||||
|
||||
var<push_constant> light: vec3<f32>;
|
||||
struct PushConstants {
|
||||
light: vec3<f32>,
|
||||
}
|
||||
var<push_constant> pc: PushConstants;
|
||||
|
||||
const SURFACE_BRIGHTNESS = 0.5;
|
||||
|
||||
@ -45,7 +48,7 @@ fn fs_main(vertex: VertexOutput) -> @location(0) vec4<f32> {
|
||||
let d = vertex.tex_coords * 2.0 - 1.0;
|
||||
|
||||
let origin = vertex.world_position;
|
||||
let direction = normalize(light - vertex.world_position);
|
||||
let direction = normalize(pc.light - vertex.world_position);
|
||||
|
||||
var normal: vec3<f32>;
|
||||
let dir_cam = normalize(camera - vertex.world_position);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user