From bec299fa6e727a59d973fc8ca8f468732d40cb14 Mon Sep 17 00:00:00 2001 From: Ame <104745335+ameknite@users.noreply.github.com> Date: Sun, 25 Jun 2023 14:50:47 -0600 Subject: [PATCH] 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 --- crates/bevy_ui/src/render/ui.wgsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_ui/src/render/ui.wgsl b/crates/bevy_ui/src/render/ui.wgsl index 389bfcd1c5..2eeb825da2 100644 --- a/crates/bevy_ui/src/render/ui.wgsl +++ b/crates/bevy_ui/src/render/ui.wgsl @@ -8,7 +8,7 @@ var view: View; struct VertexOutput { @location(0) uv: vec2, @location(1) color: vec4, - @location(3) mode: u32, + @location(3) @interpolate(flat) mode: u32, @builtin(position) position: vec4, }; @@ -39,7 +39,7 @@ fn fragment(in: VertexOutput) -> @location(0) vec4 { if in.mode == TEXTURED_QUAD { color = in.color * color; } else { - color = in.color; + color = in.color; } return color; }