Skip to content

Commit bec299f

Browse files
authored
Fix WebGPU error in "ui_pipeline" by adding a flat interpolate attribute (#8933)
# Objective - Fix this error to be able to run UI examples in WebGPU ``` 1 error(s) generated while compiling the shader: :31:18 error: integral user-defined vertex outputs must have a flat interpolation attribute @location(3) mode: u32, ^^^^ :36:1 note: while analyzing entry point 'vertex' fn vertex( ^^ ``` It was introduce in #8793 ## Solution - Add `@interpolate(flat)` to the `mode` field
1 parent 469a19c commit bec299f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/bevy_ui/src/render/ui.wgsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var<uniform> view: View;
88
struct VertexOutput {
99
@location(0) uv: vec2<f32>,
1010
@location(1) color: vec4<f32>,
11-
@location(3) mode: u32,
11+
@location(3) @interpolate(flat) mode: u32,
1212
@builtin(position) position: vec4<f32>,
1313
};
1414

@@ -39,7 +39,7 @@ fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {
3939
if in.mode == TEXTURED_QUAD {
4040
color = in.color * color;
4141
} else {
42-
color = in.color;
42+
color = in.color;
4343
}
4444
return color;
4545
}

0 commit comments

Comments
 (0)