mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Fix screenspace_texture example shader compiler error in WebGPU (Browser) (#8682)
# Objective Fix the screenspace_texture example not working on the WebGPU examples page. Currently it fails with the following error in the browser console: ``` 1 error(s) generated while compiling the shader: :213:9 error: redeclaration of 'uv' let uv = coords_to_viewport_uv(position.xy, view.viewport); ^^ :211:14 note: 'uv' previously declared here @location(2) uv: vec2<f32>, ``` ## Solution Rename the shader variable `uv` to `viewport_uv` to prevent variable redeclaration error.
This commit is contained in:
parent
bc9144bcd6
commit
594074149d
1 changed files with 2 additions and 2 deletions
|
@ -11,7 +11,7 @@ fn fragment(
|
|||
@builtin(position) position: vec4<f32>,
|
||||
#import bevy_pbr::mesh_vertex_output
|
||||
) -> @location(0) vec4<f32> {
|
||||
let uv = coords_to_viewport_uv(position.xy, view.viewport);
|
||||
let color = textureSample(texture, texture_sampler, uv);
|
||||
let viewport_uv = coords_to_viewport_uv(position.xy, view.viewport);
|
||||
let color = textureSample(texture, texture_sampler, viewport_uv);
|
||||
return color;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue