Skip to content

Commit ac04c6e

Browse files
committed
[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...
1 parent b98c9ea commit ac04c6e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/features/src/ray_shadows/shader.wgsl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ var<uniform> uniforms: Uniforms;
3333
@group(0) @binding(1)
3434
var acc_struct: acceleration_structure;
3535

36-
var<push_constant> light: vec3<f32>;
36+
struct PushConstants {
37+
light: vec3<f32>,
38+
}
39+
var<push_constant> pc: PushConstants;
3740

3841
const SURFACE_BRIGHTNESS = 0.5;
3942

@@ -45,7 +48,7 @@ fn fs_main(vertex: VertexOutput) -> @location(0) vec4<f32> {
4548
let d = vertex.tex_coords * 2.0 - 1.0;
4649

4750
let origin = vertex.world_position;
48-
let direction = normalize(light - vertex.world_position);
51+
let direction = normalize(pc.light - vertex.world_position);
4952

5053
var normal: vec3<f32>;
5154
let dir_cam = normalize(camera - vertex.world_position);

0 commit comments

Comments
 (0)