[Piglit] [PATCH 03/11] glsl-1.50: Add non-square matrix variations of UBO tests

Ian Romanick idr at freedesktop.org
Mon Sep 8 14:34:48 PDT 2014


From: Ian Romanick <ian.d.romanick at intel.com>

These tests pass on NVIDIA's closed source driver (version 331.89 on
GTX260)

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 .../uniform_buffer/gs-mat3x4-row-major.shader_test | 57 ++++++++++++++++++++++
 .../glsl-1.50/uniform_buffer/gs-mat3x4.shader_test | 57 ++++++++++++++++++++++
 .../uniform_buffer/gs-mat4x3-row-major.shader_test | 57 ++++++++++++++++++++++
 .../glsl-1.50/uniform_buffer/gs-mat4x3.shader_test | 57 ++++++++++++++++++++++
 4 files changed, 228 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/uniform_buffer/gs-mat3x4-row-major.shader_test
 create mode 100644 tests/spec/glsl-1.50/uniform_buffer/gs-mat3x4.shader_test
 create mode 100644 tests/spec/glsl-1.50/uniform_buffer/gs-mat4x3-row-major.shader_test
 create mode 100644 tests/spec/glsl-1.50/uniform_buffer/gs-mat4x3.shader_test

diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-mat3x4-row-major.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-mat3x4-row-major.shader_test
new file mode 100644
index 0000000..419d7e1
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-mat3x4-row-major.shader_test
@@ -0,0 +1,57 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+	vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+uniform ubo1 {
+	layout(row_major) mat3x4 m;
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+	for (int i = 0; i < 3; i++) {
+		gl_Position = vertex_to_gs[i];
+		v = m[0] + m[1] + m[2];
+		EmitVertex();
+	}
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+	gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+uniform mat3x4 m 0.25 0.5 0.75 1.0   1.0 2.0 3.0 4.0   -1.0 -2.0 -3.0 -4.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.25 0.5 0.75 1.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-mat3x4.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-mat3x4.shader_test
new file mode 100644
index 0000000..6505ef8
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-mat3x4.shader_test
@@ -0,0 +1,57 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+	vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+uniform ubo1 {
+	mat3x4 m;
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+	for (int i = 0; i < 3; i++) {
+		gl_Position = vertex_to_gs[i];
+		v = m[0] + m[1] + m[2];
+		EmitVertex();
+	}
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+	gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+uniform mat3x4 m 0.25 0.5 0.75 1.0   1.0 2.0 3.0 4.0   -1.0 -2.0 -3.0 -4.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.25 0.5 0.75 1.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-mat4x3-row-major.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-mat4x3-row-major.shader_test
new file mode 100644
index 0000000..c1e638b
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-mat4x3-row-major.shader_test
@@ -0,0 +1,57 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+	vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+uniform ubo1 {
+	layout(row_major) mat4x3 m;
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+	for (int i = 0; i < 3; i++) {
+		gl_Position = vertex_to_gs[i];
+		v = vec4(m[0] + m[1] + m[2] + m[3], 1.0);
+		EmitVertex();
+	}
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+	gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+uniform mat4x3 m 0.25 0.5 0.75  1.0 2.0 3.0  0.0 0.0 0.0  -1.0 -2.0 -3.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.25 0.5 0.75 1.0
diff --git a/tests/spec/glsl-1.50/uniform_buffer/gs-mat4x3.shader_test b/tests/spec/glsl-1.50/uniform_buffer/gs-mat4x3.shader_test
new file mode 100644
index 0000000..24edcb0
--- /dev/null
+++ b/tests/spec/glsl-1.50/uniform_buffer/gs-mat4x3.shader_test
@@ -0,0 +1,57 @@
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+	vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+uniform ubo1 {
+	mat4x3 m;
+};
+
+in vec4 vertex_to_gs[3];
+out vec4 v;
+
+void main()
+{
+	for (int i = 0; i < 3; i++) {
+		gl_Position = vertex_to_gs[i];
+		v = vec4(m[0] + m[1] + m[2] + m[3], 1.0);
+		EmitVertex();
+	}
+}
+
+[fragment shader]
+#version 150
+
+in vec4 v;
+
+void main()
+{
+	gl_FragColor = v;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+uniform mat4x3 m 0.25 0.5 0.75  1.0 2.0 3.0  0.0 0.0 0.0  -1.0 -2.0 -3.0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.25 0.5 0.75 1.0
-- 
1.8.1.4



More information about the Piglit mailing list