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

Taking the address of a vector component should not be allowed #7271

Open
andyleiserson opened this issue Mar 6, 2025 · 0 comments · May be fixed by #7284
Open

Taking the address of a vector component should not be allowed #7271

andyleiserson opened this issue Mar 6, 2025 · 0 comments · May be fixed by #7284
Assignees
Labels
area: naga middle-end Intermediate representation area: validation Issues related to validation, diagnostics, and error handling naga Shader Translator type: bug Something isn't working

Comments

@andyleiserson
Copy link
Contributor

The spec states (https://gpuweb.github.io/gpuweb/wgsl/#address-of-expr):

It is a shader-creation error if r is a reference to a vector component.

In naga#2451, which was a (never merged) fix for #4541, the concern was raised that passing pointers to vector components doesn't work in Metal and might need to be emulated. But if I am understanding the spec correctly, it should not be supported at all.

I would assume that the same treatment should apply to matrices. Tint appears to do so, but I don't see it stated explicitly in the spec.

The test case in #4541 is about pointers to array elements, that issue remains.

@andyleiserson andyleiserson self-assigned this Mar 6, 2025
@cwfitzgerald cwfitzgerald added type: bug Something isn't working area: validation Issues related to validation, diagnostics, and error handling naga Shader Translator area: naga middle-end Intermediate representation labels Mar 6, 2025
andyleiserson added a commit to andyleiserson/wgpu that referenced this issue Mar 6, 2025
@andyleiserson andyleiserson linked a pull request Mar 6, 2025 that will close this issue
6 tasks
andyleiserson added a commit to andyleiserson/wgpu that referenced this issue Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga middle-end Intermediate representation area: validation Issues related to validation, diagnostics, and error handling naga Shader Translator type: bug Something isn't working
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants