diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2018-10-05 12:42:27 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2018-10-24 15:14:41 -0700 |
commit | d93b78cfda4487c8bf9254f1188f114716f11cd9 (patch) | |
tree | 9ea798b6472506beb92ef15b35d059465b61bfae | |
parent | e62b088ca1c9aa13a6055bb4ba97ddf8d6047380 (diff) |
glsl-1.10: Verify that gl_TexCoord cannot be redeclared to change qualifier or type
glslangValidator rejects all of the shaders that try to change the
qualifier with errors like:
ERROR: 0:8: 'redeclaration' : cannot change qualification of gl_TexCoord
Mesa currently allows all of them to compile. Closed-source drivers
have not been tested.
glslangValidator rejects the shaders that try to change the type with:
ERROR: 0:8: 'gl_TexCoord' : redeclaration of array with a different element type
Mesa currently rejects these with a somewhat less helpful error message.
Closed-source drivers have not been tested.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Andrii Simiklit <andrii.simiklit@globallogic.com>
8 files changed, 104 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-global.frag b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-global.frag new file mode 100644 index 000000000..e2480444e --- /dev/null +++ b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-global.frag @@ -0,0 +1,13 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.10 + * [end config] + */ +#version 110 + +vec4 gl_TexCoord[2]; + +void main() +{ + gl_FragColor = vec4(0); +} diff --git a/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-global.vert b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-global.vert new file mode 100644 index 000000000..510073343 --- /dev/null +++ b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-global.vert @@ -0,0 +1,13 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.10 + * [end config] + */ +#version 110 + +vec4 gl_TexCoord[2]; + +void main() +{ + gl_Position = gl_Vertex; +} diff --git a/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-uniform.frag b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-uniform.frag new file mode 100644 index 000000000..21e33bb06 --- /dev/null +++ b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-uniform.frag @@ -0,0 +1,13 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.10 + * [end config] + */ +#version 110 + +uniform vec4 gl_TexCoord[2]; + +void main() +{ + gl_FragColor = vec4(0); +} diff --git a/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-uniform.vert b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-uniform.vert new file mode 100644 index 000000000..db734efed --- /dev/null +++ b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-uniform.vert @@ -0,0 +1,13 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.10 + * [end config] + */ +#version 110 + +uniform vec4 gl_TexCoord[2]; + +void main() +{ + gl_Position = gl_Vertex; +} diff --git a/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-varying-vec3.frag b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-varying-vec3.frag new file mode 100644 index 000000000..4c8d603db --- /dev/null +++ b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-varying-vec3.frag @@ -0,0 +1,13 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.10 + * [end config] + */ +#version 110 + +varying vec3 gl_TexCoord[2]; + +void main() +{ + gl_FragColor = vec4(0); +} diff --git a/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-varying-vec3.vert b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-varying-vec3.vert new file mode 100644 index 000000000..537a0be93 --- /dev/null +++ b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-varying-vec3.vert @@ -0,0 +1,13 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.10 + * [end config] + */ +#version 110 + +varying vec3 gl_TexCoord[2]; + +void main() +{ + gl_Position = gl_Vertex; +} diff --git a/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-varying.frag b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-varying.frag new file mode 100644 index 000000000..c40aad933 --- /dev/null +++ b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-varying.frag @@ -0,0 +1,13 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.10 + * [end config] + */ +#version 110 + +varying vec4 gl_TexCoord[2]; + +void main() +{ + gl_FragColor = vec4(0); +} diff --git a/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-varying.vert b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-varying.vert new file mode 100644 index 000000000..25950b3be --- /dev/null +++ b/tests/spec/glsl-1.10/compiler/redeclarations/gl_TexCoord-as-varying.vert @@ -0,0 +1,13 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.10 + * [end config] + */ +#version 110 + +varying vec4 gl_TexCoord[2]; + +void main() +{ + gl_Position = gl_Vertex; +} |