-
Notifications
You must be signed in to change notification settings - Fork 304
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
We should forbid pointers to handles #1832
Comments
You can also chain together
I agree we don't need the ability to form a pointer to a handle, and it only adds complexity. I think the (only) spec change is to forbid the address-of operator from operating on a reference-to-handle. |
In a future where WGSL has arrays of resources, we can relax the rule. |
WGSL meeting minutes 2021-07-20
|
I wanted to fix/comment-on a couple of items discussed in the 7-20 meeting, to make sure we're on the same page:
No, for two cases:
This isn't permitted because the type of a let-declaration must be constructible, or a pointer type. It's that last case (pointer type) that is the only change needed. |
* Disallow taking the address of a handle Fixes #1832 * simplify text
Currently the spec forbids naming the handle address space directly in text and pointers to handles are disallowed as function parameters. In order to encourage a consistent usage of samplers and textures by value, I would suggest banning
let
constants and the address of operator for types containing handles.The only way to get a pointer to a handle right now would be to use type inference in a let declaration.
Banning
let
constants isn't strictly necessary, but it doesn't provide much value if we want to disallow pointers to handles. It would really just be an aliased name.The text was updated successfully, but these errors were encountered: