-
Notifications
You must be signed in to change notification settings - Fork 669
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 invariant gl_FragCoord
for WebGL2
#3518
Comments
The essl300 spec is missing the text, but the essl310 spec has it:
I believe that the intent is actually:
That's how I'm going to rule this. |
Sounds great, thank you! |
Is
invariant gl_FragCoord
allowed under a fragment shader for both WebGL1 and WebGL2? WebGL1 and WebGL2 seem to disagree currently.Under
WebGL/sdk/tests/conformance/glsl/misc/shaders-with-invariance.html
Lines 247 to 252 in bd18b05
invariant gl_Position
in the vertex shader andinvariant gl_FragCoord
in the fragment shader under WebGL1 succeeds.If we port the same test case to WebGL2 it will currently fail under Chrome and Firefox on Windows, e.g. adding a test case with
..results in the following error:
(full test case at grovesNL@afe0a53 for convenience)
The ESSL specs both seem to say (under "Invariance" header, ESSL 1.00 10.18 or ESSL 3.00 12.13):
ESSL 3.00 restricts this a little further, which is probably where the shader compiler error originates from:
..but both ESSL 1.00 and ESSL 3.00 also mention
gl_FragCoord
invariance as a special variable:(there's no resolution for these options unfortunately)
gl_FragCoord
is an input so it's restricted based onOnly allow invariant declarations on outputs.
However the line aboutgl_FragCoord and gl_PointCoord can be qualified as invariance
implies that it should be allowed - just restricted so that it can only be specified whengl_Position
is also invariant.The text was updated successfully, but these errors were encountered: