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

Shader compilation errors on "fwidth" on wasm #1

Closed
johanhelsing opened this issue Feb 19, 2022 · 2 comments
Closed

Shader compilation errors on "fwidth" on wasm #1

johanhelsing opened this issue Feb 19, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@johanhelsing
Copy link
Owner

I think this is a bug in wasm/naga.

A workaround in the meantime would be to just disable the derivative-based anti-alias fills on wasm. Perhaps it could be done with shader defines.

@johanhelsing
Copy link
Owner Author

Turns out this was because both the fragment shader and vertex shader share the same code, and if there are fwidth calls in functions (even though they are not called), the vertex shader fails to compile.

Can be fixed by just adding shader defs for the fragment pass and conditionally include the functions containing fwidth.

@johanhelsing johanhelsing added the bug Something isn't working label Feb 22, 2022
@johanhelsing
Copy link
Owner Author

gfx-rs/wgpu#4368

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant