diff options
author | Chris Forbes <chrisf@ijw.co.nz> | 2014-08-31 19:16:42 +1200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2015-07-27 12:27:41 +0200 |
commit | b01e4f8b3108369459151b1b6860bf9c3fba5dd9 (patch) | |
tree | d7b92e36e4d80eaa34e168dfe3af050fa533e7d7 | |
parent | 74394eb2a8edb9491278177fdd8ebba6e212fd8d (diff) |
arb_tessellation_shader: Add tests for TCS output l-value indexing
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 files changed, 159 insertions, 0 deletions
diff --git a/tests/spec/arb_tessellation_shader/compiler/custom-block-out-indexing-const.tesc b/tests/spec/arb_tessellation_shader/compiler/custom-block-out-indexing-const.tesc new file mode 100644 index 000000000..e7a44e0ee --- /dev/null +++ b/tests/spec/arb_tessellation_shader/compiler/custom-block-out-indexing-const.tesc @@ -0,0 +1,24 @@ +// [config] +// expect_result: fail +// glsl_version: 1.50 +// require_extensions: GL_ARB_tessellation_shader +// [end config] + +#version 150 +#extension GL_ARB_tessellation_shader: require + +layout(vertices = 3) out; + +out block { + vec4 y[4]; +} x[]; + +/* If a per-vertex output variable is used as an l-value, it is an + * error if the expression indicating the vertex number is not the + * identifier "gl_InvocationID". + */ + +void main() +{ + x[0].y[0] = vec4(0); +} diff --git a/tests/spec/arb_tessellation_shader/compiler/custom-out-indexing-const.tesc b/tests/spec/arb_tessellation_shader/compiler/custom-out-indexing-const.tesc new file mode 100644 index 000000000..fb8ff88d0 --- /dev/null +++ b/tests/spec/arb_tessellation_shader/compiler/custom-out-indexing-const.tesc @@ -0,0 +1,22 @@ +// [config] +// expect_result: fail +// glsl_version: 1.50 +// require_extensions: GL_ARB_tessellation_shader +// [end config] + +#version 150 +#extension GL_ARB_tessellation_shader: require + +layout(vertices = 3) out; + +out vec4 x[]; + +/* If a per-vertex output variable is used as an l-value, it is an + * error if the expression indicating the vertex number is not the + * identifier "gl_InvocationID". + */ + +void main() +{ + x[0] = vec4(0); +} diff --git a/tests/spec/arb_tessellation_shader/compiler/custom-out-indexing-strict.tesc b/tests/spec/arb_tessellation_shader/compiler/custom-out-indexing-strict.tesc new file mode 100644 index 000000000..92461c584 --- /dev/null +++ b/tests/spec/arb_tessellation_shader/compiler/custom-out-indexing-strict.tesc @@ -0,0 +1,25 @@ +// [config] +// expect_result: fail +// glsl_version: 1.50 +// require_extensions: GL_ARB_tessellation_shader +// [end config] + +#version 150 +#extension GL_ARB_tessellation_shader: require + +layout(vertices = 3) out; +out vec4 x[]; + +/* If a per-vertex output variable is used as an l-value, it is an + * error if the expression indicating the vertex number is not the + * identifier "gl_InvocationID". + * + * This test interprets the requirement strictly -- even though `n` + * will take the correct value, this is not allowed. + */ + +void main() +{ + int n = gl_InvocationID; + x[n] = vec4(0); +} diff --git a/tests/spec/arb_tessellation_shader/compiler/custom-out-indexing-uniform.tesc b/tests/spec/arb_tessellation_shader/compiler/custom-out-indexing-uniform.tesc new file mode 100644 index 000000000..71e0cd199 --- /dev/null +++ b/tests/spec/arb_tessellation_shader/compiler/custom-out-indexing-uniform.tesc @@ -0,0 +1,23 @@ +// [config] +// expect_result: fail +// glsl_version: 1.50 +// require_extensions: GL_ARB_tessellation_shader +// [end config] + +#version 150 +#extension GL_ARB_tessellation_shader: require + +layout(vertices = 3) out; + +uniform int n; +out vec4 x[]; + +/* If a per-vertex output variable is used as an l-value, it is an + * error if the expression indicating the vertex number is not the + * identifier "gl_InvocationID". + */ + +void main() +{ + x[n] = vec4(0); +} diff --git a/tests/spec/arb_tessellation_shader/compiler/gl_out-indexing-const.tesc b/tests/spec/arb_tessellation_shader/compiler/gl_out-indexing-const.tesc new file mode 100644 index 000000000..e1a424e8f --- /dev/null +++ b/tests/spec/arb_tessellation_shader/compiler/gl_out-indexing-const.tesc @@ -0,0 +1,20 @@ +// [config] +// expect_result: fail +// glsl_version: 1.50 +// require_extensions: GL_ARB_tessellation_shader +// [end config] + +#version 150 +#extension GL_ARB_tessellation_shader: require + +layout(vertices = 3) out; + +/* If a per-vertex output variable is used as an l-value, it is an + * error if the expression indicating the vertex number is not the + * identifier "gl_InvocationID". + */ + +void main() +{ + gl_out[0].gl_Position = vec4(0); +} diff --git a/tests/spec/arb_tessellation_shader/compiler/gl_out-indexing-strict.tesc b/tests/spec/arb_tessellation_shader/compiler/gl_out-indexing-strict.tesc new file mode 100644 index 000000000..a328b5755 --- /dev/null +++ b/tests/spec/arb_tessellation_shader/compiler/gl_out-indexing-strict.tesc @@ -0,0 +1,24 @@ +// [config] +// expect_result: fail +// glsl_version: 1.50 +// require_extensions: GL_ARB_tessellation_shader +// [end config] + +#version 150 +#extension GL_ARB_tessellation_shader: require + +layout(vertices = 3) out; + +/* If a per-vertex output variable is used as an l-value, it is an + * error if the expression indicating the vertex number is not the + * identifier "gl_InvocationID". + * + * This test interprets the requirement strictly -- even though `n` + * will take the correct value, this is not allowed. + */ + +void main() +{ + int n = gl_InvocationID; + gl_out[n].gl_Position = vec4(0); +} diff --git a/tests/spec/arb_tessellation_shader/compiler/gl_out-indexing-uniform.tesc b/tests/spec/arb_tessellation_shader/compiler/gl_out-indexing-uniform.tesc new file mode 100644 index 000000000..1bc8f65a0 --- /dev/null +++ b/tests/spec/arb_tessellation_shader/compiler/gl_out-indexing-uniform.tesc @@ -0,0 +1,21 @@ +// [config] +// expect_result: fail +// glsl_version: 1.50 +// require_extensions: GL_ARB_tessellation_shader +// [end config] + +#version 150 +#extension GL_ARB_tessellation_shader: require + +layout(vertices = 3) out; +uniform int n; + +/* If a per-vertex output variable is used as an l-value, it is an + * error if the expression indicating the vertex number is not the + * identifier "gl_InvocationID". + */ + +void main() +{ + gl_out[n].gl_Position = vec4(0); +} |