-
Notifications
You must be signed in to change notification settings - Fork 194
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
WGSL backend writes invalid WGSL in some cases #2461
Comments
The As for the undefined |
🤦 . Silly me! After fixing that bumble the WGSL parser spits out an error that's much more on-topic:
When compiled to MSL it looks like the identifier is
|
Ah, interesting; This will be fixed by gfx-rs/wgpu#4568. However, WGSL doesn't currently support infinities or NaN. It seems we don't have validation for that yet but will in the future. |
Ok, thanks @teoxoy. This must be happening because of my use of So the short-term fix is to write a new implentation of |
No, it will only fix the "no definition in scope for identifier: 'inf'" error. But in the future validation will complain instead. The long term solution to fully support infinities and NaNs will most likely be an extension that would map to SPIR-V's |
Thanks @teoxoy. Indeed it seems the same thing happens with any references to |
With #2508 you should now get (for the SPIR-V shader in the description):
|
Given this SPV input
(fragment_equirectangular.spv.zip) naga will write invalid wgsl output. You can see in this generated wgsl source that there is an undefined variable
inf
:This source fails to parse - it errs with
InvalidHeader
.Here's my test case:
The text was updated successfully, but these errors were encountered: