Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix screenspace_texture example shader compiler error in WebGPU (Browser) #8682

Merged
merged 1 commit into from
May 25, 2023

Conversation

marlyx
Copy link
Contributor

@marlyx marlyx commented May 25, 2023

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.

@nicopap nicopap added C-Examples An addition or correction to our examples P-Crash A sudden unexpected crash O-Web Specific to web (WASM) builds A-Rendering Drawing game state to the screen labels May 25, 2023
@nicopap nicopap added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label May 25, 2023
@mockersf mockersf added this pull request to the merge queue May 25, 2023
@mockersf
Copy link
Member

naga will error on this on all backends on the next version: gfx-rs/naga#2342

Merged via the queue into bevyengine:main with commit 5940741 May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples O-Web Specific to web (WASM) builds P-Crash A sudden unexpected crash S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants