[Piglit] [PATCH 2/4] glsl-1.10: Add tests for this assertion failure in i965:
Eric Anholt
eric at anholt.net
Mon May 14 16:30:06 PDT 2012
shader_runner: brw_vec4_visitor.cpp:1642: virtual void
brw::vec4_visitor::visit(ir_assignment*): Assertion `src.swizzle ==
(ir->rhs->type->is_matrix() ?
swizzle_for_size(ir->rhs->type->vector_elements) : (((0)<<0) |
((1)<<2) | ((2)<<4) | ((3)<<6)))' failed.
---
.../execution/vs-mat2-array-assignment.shader_test | 34 ++++++++++++++++++
.../vs-mat2-struct-assignment.shader_test | 36 ++++++++++++++++++++
2 files changed, 70 insertions(+)
create mode 100644 tests/spec/glsl-1.10/execution/vs-mat2-array-assignment.shader_test
create mode 100644 tests/spec/glsl-1.10/execution/vs-mat2-struct-assignment.shader_test
diff --git a/tests/spec/glsl-1.10/execution/vs-mat2-array-assignment.shader_test b/tests/spec/glsl-1.10/execution/vs-mat2-array-assignment.shader_test
new file mode 100644
index 0000000..9155676
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/vs-mat2-array-assignment.shader_test
@@ -0,0 +1,34 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+uniform mat2 m[2];
+
+void main()
+{
+ gl_Position = gl_Vertex;
+ mat2 a = m[0];
+ mat2 b = m[1];
+
+ /* Prevent copy propagation to help trigger the driver bug on
+ * the assignment above.
+ */
+ a[0].x = 0.0;
+ b[0].x = 0.0;
+
+ if (a == b)
+ gl_FrontColor = vec4(0.0, 1.0, 0.0, 0.0);
+ else
+ gl_FrontColor = vec4(1.0, 0.0, 0.0, 0.0);
+}
+
+[fragment shader]
+void main() {
+ gl_FragColor = gl_Color;
+}
+
+[test]
+uniform mat2x2 m[0] 0.0 1.0 2.0 3.0
+uniform mat2x2 m[1] 0.0 1.0 2.0 3.0
+draw rect -1 -1 2 2
+probe all rgba 0 1 0 0
diff --git a/tests/spec/glsl-1.10/execution/vs-mat2-struct-assignment.shader_test b/tests/spec/glsl-1.10/execution/vs-mat2-struct-assignment.shader_test
new file mode 100644
index 0000000..dcfd3eb
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/vs-mat2-struct-assignment.shader_test
@@ -0,0 +1,36 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+uniform struct {
+ mat2 a, b;
+} m;
+
+void main()
+{
+ gl_Position = gl_Vertex;
+ mat2 a = m.a;
+ mat2 b = m.b;
+
+ /* Prevent copy propagation to help trigger the driver bug on
+ * the assignment above.
+ */
+ a[0].x = 0.0;
+ b[0].x = 0.0;
+
+ if (a == b)
+ gl_FrontColor = vec4(0.0, 1.0, 0.0, 0.0);
+ else
+ gl_FrontColor = vec4(1.0, 0.0, 0.0, 0.0);
+}
+
+[fragment shader]
+void main() {
+ gl_FragColor = gl_Color;
+}
+
+[test]
+uniform mat2x2 m.a 0.0 1.0 2.0 3.0
+uniform mat2x2 m.b 0.0 1.0 2.0 3.0
+draw rect -1 -1 2 2
+probe all rgba 0 1 0 0
--
1.7.10
More information about the Piglit
mailing list