-
Notifications
You must be signed in to change notification settings - Fork 195
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 front end rejects negative constant literal subscripts, but spec says they're permitted #989
Comments
To be clear, I 100% agree that it's a better developer experience to have this signaled at compile time, and that for uses outside the web the current behavior is preferable. But Naga also needs to be able to provide strict compliance when used in WebGPU. So if we want to retain the ability to flag the program statically, it needs to be configurable. And I think we should consider carefully whether we want the complexity of that configuration. |
The reason this happens is that Lines 1756 to 1780 in a7d3b60
|
Yes - I came across that and was really happy to see that you'd used |
Closing as this is obsolete. Since const-expressions have been added to the spec we are now required to raise OOB errors. |
The WGSL specification says that
a[-1]
for some arraya
is permitted, and accesses some unspecified element ofa
, but our front end rejects this:This is hardly the biggest fish we have to fry, but it's important for web compatibility that implementations agree on when errors are signaled and when they are tolerated. This particular case, of indexes that are easy recognized at compile time to be invalid, has been discussed in the committee meetings, and the decision was that they should be permitted to run.
The text was updated successfully, but these errors were encountered: