-
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
Allow array_index
to be unsigned
#2298
Conversation
Alright, this is far outside my comfort zone. Any help would be appreciated. I assume that either some code was relying on this value being a |
SPIR-V requires a vector containing the coordinates and the array index. The type of the vector has to match with the type of the scalars that compose it and it's here that we assume the Lines 317 to 352 in 7c00548
|
@teoxoy thank you for the help. I hope I didn't go overkill on the checks here. |
No problem :) |
Could you point me in any specific direction, or do you have something in mind? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing all the comments - looks great!
Could you also add a few more tests for this?
Could you point me in any specific direction, or do you have something in mind?
It seems the only test updated was textureLoad
. I think we should at least test textureStore
and textureSample
as well. The other texture sampling functions use the same code paths so we might not need to test those.
Added a bunch more tests, hope that's not overkill. |
Following the spec, functions with the parameter
array_index
, e.g. in combination withtexture_2d_array
, should be able to take au32
as well:https://www.w3.org/TR/WGSL/#textureload
https://www.w3.org/TR/WGSL/#texturesample
https://www.w3.org/TR/WGSL/#texturestore
(I have no clue how to link to a more permanent version of the spec)