-
Notifications
You must be signed in to change notification settings - Fork 670
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
Clarify discarded expressions of uniform block reference through instance name only #3644
Comments
The discussion in 2024-04-18 meeting was that it likely would be invalid to refer to uniform block instance itself. |
OpenGL ES 3.0, Section 2.12.16:
WebGL 2.0:
I think it means that a discarded instance name has no effect on uniform usage limits - all members of such blocks are always considered active in WebGL. |
Per WebGL conference call from 2024-09-05, the next action on this issue is to write a new conformance test confirming the behavior. The OpenGL working group plans to update their specification, so there is no current plan to update the WebGL spec. |
I'm writing this |
Consider uniform block declaration with a instance-name:
uniform MyBlock { int x; int y; } b;
The spec spends effort to disallow using
b
without any field access. You aren't allowed to useMyBlock
, so it is not easy to refer to plainb
in a valid program.Except, you can use it in a discarded statement expression, like
b;
or in a comma expression likesomethingsomething, b;
This is a problem because some rewrite steps don't anticipate uniform blocks, and ANGLE assert with these.
Would it be in the spirit of the spec to fail these programs, or should they pass?
As per my reading, that could affect the statically used uniform counts? However, I can't parse the spec to understand if individual members of an uniform block are affected with different static use counts. E.g. if I refer to b.x; does it mean that b.y can be optimized away if not used? Would b; in this case mean that all uniform variables of that block are statically used.
https://registry.khronos.org/OpenGL/specs/es/3.0/GLSL_ES_Specification_3.00.pdf
The text was updated successfully, but these errors were encountered: