Skip to content

Commit

Permalink
Change attribute / uniform conflict rules. (KhronosGroup#3213)
Browse files Browse the repository at this point in the history
The OpenGL ES working group has confirmed that even in the GLSL ES
1.00 specification, the intent is that the vertex and fragment shaders
have distinct namespaces. Attributes in the vertex shader do not
conflict with uniforms in the fragment shader.

Remove the now-invalid test from the 1.0.3 and 2.0.0 snapshots.

Fixes KhronosGroup#3201.
  • Loading branch information
kenrussell authored Feb 2, 2021
1 parent 301473c commit b6fdf0e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 221 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ shader-with-webgl-identifier.vert.html
shader-without-precision.frag.html
--min-version 1.0.3 shaders-with-constant-expression-loop-conditions.html
--min-version 1.0.3 shaders-with-invariance.html
--min-version 1.0.3 shaders-with-name-conflicts.html
--min-version 1.0.2 shaders-with-mis-matching-uniforms.html
--min-version 1.0.2 shaders-with-mis-matching-varyings.html
--min-version 1.0.2 shaders-with-missing-varyings.html
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ shader-with-webgl-identifier.vert.html
shader-without-precision.frag.html
--min-version 1.0.3 shaders-with-constant-expression-loop-conditions.html
--min-version 1.0.3 shaders-with-invariance.html
--min-version 1.0.3 shaders-with-name-conflicts.html
--min-version 1.0.2 shaders-with-mis-matching-uniforms.html
--min-version 1.0.2 shaders-with-mis-matching-varyings.html
--min-version 1.0.2 shaders-with-missing-varyings.html
Expand Down

This file was deleted.

27 changes: 16 additions & 11 deletions sdk/tests/conformance/glsl/misc/shaders-with-name-conflicts.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@
"use strict";

/*
GLSL 1.017 section 4.2.6
This test previously concluded that an attribute in a vertex shader
would conflict across shaders with a uniform of the same name in the
fragment shader, based on the following sections of the GLSL ES 1.0.17
specification:
---
Section 4.2.6
...
Expand All @@ -56,25 +62,24 @@
Section 4.3.4
The uniform qualifier is used to declare global variables
---
QED: If both uniforms and attributes are in the global namespace they
conflict across shaders
Note: This was brought up on the OpenGL ES working group and confirmed
that the spec required these conflicts to fail to link.
GLSL ES 3.00 later confirmed that pipeline stages have distinct
namespaces. The OpenGL ES working group confirmed in discussions
https://github.com/KhronosGroup/WebGL/issues/3201 that this was the
intended behavior for GLSL ES 1.00.
Though most drivers allow this to work, some drivers to do no therefore
WebGL implementation must enforce this restriction to provide consistent
behavior.
For this reason, this test asserts that such usage does not generate a
conflict.
*/

GLSLConformanceTester.runTests([
{ vShaderId: 'vertexShader',
vShaderSuccess: true,
fShaderId: 'fragmentShader',
fShaderSuccess: true,
linkSuccess: false,
passMsg: 'shaders with conflicting uniform/attribute names should fail'
linkSuccess: true,
passMsg: 'using the same name for a vertex shader attribute and fragment shader uniform should succeed'
},
]);
var successfullyParsed = true;
Expand Down

0 comments on commit b6fdf0e

Please sign in to comment.