[Piglit] [PATCH] glsl-1.20: test implicitly sized arrays match explicitly sized arrays across the same stage
Timothy Arceri
t_arceri at yahoo.com.au
Tue Nov 25 04:09:42 PST 2014
Signed-off-by: Timothy Arceri <t_arceri at yahoo.com.au>
---
.../intrastage-unsized-array-mismatch.shader_test | 33 ++++++++++++++++++++++
.../intrastage-unsized-array-mismatch2.shader_test | 33 ++++++++++++++++++++++
.../linker/intrastage-unsized-array.shader_test | 33 ++++++++++++++++++++++
.../linker/intrastage-unsized-array2.shader_test | 33 ++++++++++++++++++++++
4 files changed, 132 insertions(+)
create mode 100644 tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch.shader_test
create mode 100644 tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch2.shader_test
create mode 100644 tests/spec/glsl-1.20/linker/intrastage-unsized-array.shader_test
create mode 100644 tests/spec/glsl-1.20/linker/intrastage-unsized-array2.shader_test
diff --git a/tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch.shader_test b/tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch.shader_test
new file mode 100644
index 0000000..cdf3a91
--- /dev/null
+++ b/tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch.shader_test
@@ -0,0 +1,33 @@
+# This test verifies that a link error is generated if implicitly sized
+# arrays dont match explicitly sized arrays across the same stage.
+
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+varying vec4 color[3];
+
+void f()
+{
+ color[1] = vec4(1, 0, 0, 1);
+}
+
+[vertex shader]
+#version 120
+
+varying vec4 color[];
+
+void f();
+
+void main()
+{
+ f();
+ color[3] = vec4(1, 0, 0, 1);
+
+ gl_Position = gl_Vertex;
+}
+
+[test]
+link error
diff --git a/tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch2.shader_test b/tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch2.shader_test
new file mode 100644
index 0000000..764469a
--- /dev/null
+++ b/tests/spec/glsl-1.20/linker/intrastage-unsized-array-mismatch2.shader_test
@@ -0,0 +1,33 @@
+# This test verifies that a link error is generated if implicitly sized
+# arrays dont match explicitly sized arrays across the same stage.
+
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+varying vec4 color[];
+
+void f()
+{
+ color[3] = vec4(1, 0, 0, 1);
+}
+
+[vertex shader]
+#version 120
+
+varying vec4 color[3];
+
+void f();
+
+void main()
+{
+ f();
+ color[2] = vec4(1, 0, 0, 1);
+
+ gl_Position = gl_Vertex;
+}
+
+[test]
+link error
diff --git a/tests/spec/glsl-1.20/linker/intrastage-unsized-array.shader_test b/tests/spec/glsl-1.20/linker/intrastage-unsized-array.shader_test
new file mode 100644
index 0000000..6fdd806
--- /dev/null
+++ b/tests/spec/glsl-1.20/linker/intrastage-unsized-array.shader_test
@@ -0,0 +1,33 @@
+# Test implicitly sized arrays match explicitly sized arrays
+# across the same stage.
+
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+varying vec4 color[4];
+
+void f()
+{
+ color[1] = vec4(1, 0, 0, 1);
+}
+
+[vertex shader]
+#version 120
+
+varying vec4 color[];
+
+void f();
+
+void main()
+{
+ f();
+ color[3] = vec4(1, 0, 0, 1);
+
+ gl_Position = gl_Vertex;
+}
+
+[test]
+link success
diff --git a/tests/spec/glsl-1.20/linker/intrastage-unsized-array2.shader_test b/tests/spec/glsl-1.20/linker/intrastage-unsized-array2.shader_test
new file mode 100644
index 0000000..6af80c2
--- /dev/null
+++ b/tests/spec/glsl-1.20/linker/intrastage-unsized-array2.shader_test
@@ -0,0 +1,33 @@
+# Test implicitly sized arrays match explicitly sized arrays
+# across the same stage.
+
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+varying vec4 color[];
+
+void f()
+{
+ color[3] = vec4(1, 0, 0, 1);
+}
+
+[vertex shader]
+#version 120
+
+varying vec4 color[4];
+
+void f();
+
+void main()
+{
+ f();
+ color[1] = vec4(1, 0, 0, 1);
+
+ gl_Position = gl_Vertex;
+}
+
+[test]
+link success
--
1.9.3
More information about the Piglit
mailing list