-
Notifications
You must be signed in to change notification settings - Fork 370
Uniformity annotations for global variables #1791
Copy link
Copy link
Open
Labels
uniformityIssues / discussions around uniformity analysisIssues / discussions around uniformity analysiswgslWebGPU Shading Language IssuesWebGPU Shading Language Issues
Milestone
Description
The uniformity analysis (still under discussion, see #1571) treats all accesses to global variables as non-uniform.
If I understood @kvark right, Naga currently uses global variables that always contain uniform data when compiling some builtins from SPIRV. It would be quite easy to support this use case by providing an annotation that could be added to these variables.
It would be trivial for the analysis to use these annotations:
- Verify that any store to such a variable is of a uniform value (and in uniform control-flow)
- Assume that every read from such a variable sees a uniform value.
Such annotations may also be useful for programmers outside of Naga, so I'd rather have them as something supported in the spec than as a Naga-specific hack.
I have no opinion on the syntax that would be best for them. The simplest might be an attribute [AlwaysUniformValue] or something like that.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
uniformityIssues / discussions around uniformity analysisIssues / discussions around uniformity analysiswgslWebGPU Shading Language IssuesWebGPU Shading Language Issues
Type
Projects
Status
Done