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 WebGPU error in "ui_pipeline" by adding a flat interpolate attribute #8933

Merged
merged 1 commit into from Jun 25, 2023

Conversation

ameknite
Copy link
Contributor

@ameknite ameknite commented Jun 22, 2023

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

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior O-Web Specific to web (WASM) builds labels Jun 22, 2023
@alice-i-cecile alice-i-cecile added this to the 0.11 milestone Jun 22, 2023
@alice-i-cecile
Copy link
Member

A simple enough fix, and a good whitespace fix thrown in.

Sorry about the random ping stranger 😅 Next time @ameknite, you can use code blocks to suppress accidental pings like that :)

@ameknite
Copy link
Contributor Author

@alice-i-cecile oh I didn't realize, fixed, thanks.

@mockersf mockersf 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 Jun 25, 2023
@mockersf mockersf added this pull request to the merge queue Jun 25, 2023
@mockersf
Copy link
Member

This is part of the wgsl spec: https://www.w3.org/TR/WGSL/#interpolation

User-defined vertex outputs and fragment inputs of scalar or vector integer type must always be specified as @interpolate(flat).

If wgpu doesn't catch it on all stacks, it should be added there

Merged via the queue into bevyengine:main with commit bec299f Jun 25, 2023
26 checks passed
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 A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior O-Web Specific to web (WASM) builds 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.

None yet

4 participants