diff mbox

glsl-1.20: test implicitly sized arrays match explicitly sized arrays across the same stage

Message ID 1416917382-1854-1-git-send-email-t_arceri@yahoo.com.au
State New
Headers show

Commit Message

'Timothy Arceri' via Patchwork Forward Nov. 25, 2014, 12:09 p.m. UTC
Signed-off-by: Timothy Arceri <t_arceri@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 mbox

Patch

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