diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2018-10-05 16:08:58 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2018-10-24 15:14:41 -0700 |
commit | 7045dfa0c6baead0d27d0ad2753cff619b3964e5 (patch) | |
tree | 1dea8cce037b5f5782e5fbe75a99fb1e61e336e8 | |
parent | d93b78cfda4487c8bf9254f1188f114716f11cd9 (diff) |
glsl-1.30: Verify that gl_ClipDistance 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_ClipDistance
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_ClipDistance' : 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>
9 files changed, 117 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-global.frag b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-global.frag new file mode 100644 index 000000000..fa110729d --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-global.frag @@ -0,0 +1,13 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.30 + * [end config] + */ +#version 130 + +float gl_ClipDistance[2]; + +void main() +{ + gl_FragColor = vec4(0); +} diff --git a/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-global.vert b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-global.vert new file mode 100644 index 000000000..0ad68c03d --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-global.vert @@ -0,0 +1,13 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.30 + * [end config] + */ +#version 130 + +float gl_ClipDistance[2]; + +void main() +{ + gl_Position = gl_Vertex; +} diff --git a/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-in-vec2.frag b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-in-vec2.frag new file mode 100644 index 000000000..4ce080b38 --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-in-vec2.frag @@ -0,0 +1,13 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.30 + * [end config] + */ +#version 130 + +in vec2 gl_ClipDistance[2]; + +void main() +{ + gl_FragColor = vec4(0); +} diff --git a/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-in.frag b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-in.frag new file mode 100644 index 000000000..bf6a25a58 --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-in.frag @@ -0,0 +1,13 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.30 + * [end config] + */ +#version 130 + +in float gl_ClipDistance[2]; + +void main() +{ + gl_FragColor = vec4(0); +} diff --git a/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-out-vec2.vert b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-out-vec2.vert new file mode 100644 index 000000000..2bd667f55 --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-out-vec2.vert @@ -0,0 +1,13 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.30 + * [end config] + */ +#version 130 + +out vec2 gl_ClipDistance[2]; + +void main() +{ + gl_Position = gl_Vertex; +} diff --git a/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-out.frag b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-out.frag new file mode 100644 index 000000000..d0e7ec508 --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-out.frag @@ -0,0 +1,13 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.30 + * [end config] + */ +#version 130 + +out float gl_ClipDistance[2]; + +void main() +{ + gl_FragColor = vec4(0); +} diff --git a/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-out.vert b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-out.vert new file mode 100644 index 000000000..6d7dee0ab --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-out.vert @@ -0,0 +1,13 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.30 + * [end config] + */ +#version 130 + +out float gl_ClipDistance[2]; + +void main() +{ + gl_Position = gl_Vertex; +} diff --git a/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-uniform.frag b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-uniform.frag new file mode 100644 index 000000000..f36c7f69c --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-uniform.frag @@ -0,0 +1,13 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.30 + * [end config] + */ +#version 130 + +uniform float gl_ClipDistance[2]; + +void main() +{ + gl_FragColor = vec4(0); +} diff --git a/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-uniform.vert b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-uniform.vert new file mode 100644 index 000000000..59e9501c9 --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/redeclarations/gl_ClipDistance-as-uniform.vert @@ -0,0 +1,13 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.30 + * [end config] + */ +#version 130 + +uniform float gl_ClipDistance[2]; + +void main() +{ + gl_Position = gl_Vertex; +} |