summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-09-07 18:16:57 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-10-11 12:07:28 +0200
commitd8fd5ee389f5fe399a738b2ac2a6d8d6bfed23db (patch)
tree565becb48f8e036f3381e485fbe88576b37bcf23
parentea500ecc61c6e800af45ab32a67ebfa3f9a46169 (diff)
arb_tessellation_shader: add a test with an array in a struct in a per-vertex TCS out
This currently hits a bug in Mesa's GLSL-to-TGSI conversion.
-rw-r--r--tests/spec/arb_tessellation_shader/execution/variable-indexing/tcs-tes-array-in-struct.shader_test78
1 files changed, 78 insertions, 0 deletions
diff --git a/tests/spec/arb_tessellation_shader/execution/variable-indexing/tcs-tes-array-in-struct.shader_test b/tests/spec/arb_tessellation_shader/execution/variable-indexing/tcs-tes-array-in-struct.shader_test
new file mode 100644
index 000000000..8611bdfa7
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/variable-indexing/tcs-tes-array-in-struct.shader_test
@@ -0,0 +1,78 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+[vertex shader passthrough]
+
+[tessellation control shader]
+#version 150
+#extension GL_ARB_tessellation_shader : require
+
+layout(vertices = 4) out;
+
+struct S {
+ int v[2];
+};
+
+out S tcs_tes_s[];
+
+void main()
+{
+ for (int i = 0; i < 2; ++i)
+ tcs_tes_s[gl_InvocationID].v[i] = gl_InvocationID * 2 + i;
+
+// gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
+ gl_TessLevelOuter = float[4](3.0, 3.0, 3.0, 3.0);
+ gl_TessLevelInner = float[2](3.0, 3.0);
+}
+
+[tessellation evaluation shader]
+#version 150
+#extension GL_ARB_tessellation_shader : require
+
+layout(quads, equal_spacing) in;
+
+struct S {
+ int v[2];
+};
+
+in S tcs_tes_s[];
+
+out vec4 color;
+
+void main()
+{
+ gl_Position = vec4(gl_TessCoord.xy * 2 - 1, 0, 1);
+
+ for (int i = 0; i < 4; ++i) {
+ for (int j = 0; j < 2; ++j) {
+ int expected = i * 2 + j;
+ int actual = tcs_tes_s[i].v[j];
+ if (expected != actual) {
+ color = vec4(1.0, float(expected) / 255.0, float(actual) / 255.0, 0.0);
+ return;
+ }
+ }
+ }
+
+ color = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[fragment shader]
+#version 150
+in vec4 color;
+out vec4 outcolor;
+
+void main()
+{
+ outcolor = color;
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+patch parameter vertices 1
+draw arrays GL_PATCHES 0 1
+
+probe all rgba 0 1 0 1