[Piglit] [PATCH 1/2] glsl-1.50 compiler: Test that arrays can be used as inputs to vertex shader

Steve Miller dervishx at gmail.com
Mon Jul 15 16:12:53 PDT 2013


Test all types.
---
 .../glsl-1.50/compiler/input-arrays-float.vert     | 20 +++++++++++++
 .../spec/glsl-1.50/compiler/input-arrays-int.vert  | 31 +++++++++++++++++++
 .../spec/glsl-1.50/compiler/input-arrays-mat.vert  | 35 ++++++++++++++++++++++
 .../spec/glsl-1.50/compiler/input-arrays-uint.vert | 26 ++++++++++++++++
 4 files changed, 112 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/compiler/input-arrays-float.vert
 create mode 100644 tests/spec/glsl-1.50/compiler/input-arrays-int.vert
 create mode 100644 tests/spec/glsl-1.50/compiler/input-arrays-mat.vert
 create mode 100644 tests/spec/glsl-1.50/compiler/input-arrays-uint.vert

diff --git a/tests/spec/glsl-1.50/compiler/input-arrays-float.vert b/tests/spec/glsl-1.50/compiler/input-arrays-float.vert
new file mode 100644
index 0000000..f5cf79a
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/input-arrays-float.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+
+#version 150
+
+in float a[2];
+in vec2 b[2];
+in vec3 c[2]; 
+in vec4 d[2]; 
+
+void main()
+{
+	gl_Position = vec4(a[0] + a[1] + 
+			b[0].x + b[1].x +
+			c[0].x + c[1].x +
+			d[0].x + d[1].x); 
+}
diff --git a/tests/spec/glsl-1.50/compiler/input-arrays-int.vert b/tests/spec/glsl-1.50/compiler/input-arrays-int.vert
new file mode 100644
index 0000000..b8eb5d4
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/input-arrays-int.vert
@@ -0,0 +1,31 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+//
+// Tests that arrays can be inputs to the vertex shader
+/*
+* GLSLLangSpec.1.50.09 Inputs:
+*
+* Vertex shader inputs can only be float, floating-point
+* vectors, matrices, signed and unsigned integers and integer vectors. 
+* Vertex shader inputs can also form arrays of these types, but not 
+* structures.
+*
+*/
+
+#version 150
+			//slots
+in int a[2]; 		//2
+in ivec2 b[2];		//4
+in ivec3 c[2];		//6
+in ivec4 d[2];		//8
+
+void main()
+{
+	gl_Position = vec4(a[0] + a[1] +
+			b[0].x + b[1].x +
+			c[0].x + c[1].x +
+			d[0].x + d[1].x);
+}
diff --git a/tests/spec/glsl-1.50/compiler/input-arrays-mat.vert b/tests/spec/glsl-1.50/compiler/input-arrays-mat.vert
new file mode 100644
index 0000000..370cf2a
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/input-arrays-mat.vert
@@ -0,0 +1,35 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+//
+// Tests that arrays (of matrices) can be inputs to the vertex shader
+/*
+* GLSLLangSpec.1.50.09 Inputs:
+*
+* Vertex shader inputs can only be float, floating-point
+* vectors, matrices, signed and unsigned integers and integer vectors. 
+* Vertex shader inputs can also form arrays of these types, but not 
+* structures.
+*
+*/
+
+#version 150
+
+in mat2 a[2];		//2x2x2		8
+in mat3 b[2];		//3x2x2		12
+in mat4 c[2];		//4x2x2		16
+//				=	36
+
+void main()
+{
+	gl_Position = vec4(
+			a[0][0].x + a[0][1].x +
+			a[1][0].x + a[1][1].x +
+			b[0][0].x + b[0][1].x +
+			b[1][0].x + b[1][1].x +
+			c[0][0].x + c[0][1].x +
+			c[1][0].x + c[1][1].x 
+			);
+}
diff --git a/tests/spec/glsl-1.50/compiler/input-arrays-uint.vert b/tests/spec/glsl-1.50/compiler/input-arrays-uint.vert
new file mode 100644
index 0000000..0d834b4
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/input-arrays-uint.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+
+// Section 4.3.4 (Inputs) of GLSL 1.50 spec states:
+//	"Vertex shader inputs can only be float, floating-point
+//	vectors, matrices, signed and unsigned integers and integer 
+//	vectors. Vertex shader inputs can also form
+//	arrays of these types, but not structures."
+
+#version 150
+
+in uint  a[2];
+in uvec2 b[2];
+in uvec3 c[2];
+in uvec4 d[2];
+
+void main()
+{
+    gl_Position = vec4(a[0] + a[1]
+			+ b[0].x + b[1].x
+			+ c[0].x + c[1].x
+			+ d[0].x + d[1].x);
+}
-- 
1.8.3.1



More information about the Piglit mailing list