[Piglit] [PATCH 1/2] glsl-1.40: Add a new UBO test for a potential bug in the i965 driver.
Eric Anholt
eric at anholt.net
Thu Nov 15 11:03:12 PST 2012
---
.../fs-saturated-vec-array.shader_test | 42 ++++++++++++++++++++
1 file changed, 42 insertions(+)
create mode 100644 tests/spec/glsl-1.40/uniform_buffer/fs-saturated-vec-array.shader_test
diff --git a/tests/spec/glsl-1.40/uniform_buffer/fs-saturated-vec-array.shader_test b/tests/spec/glsl-1.40/uniform_buffer/fs-saturated-vec-array.shader_test
new file mode 100644
index 0000000..d540878
--- /dev/null
+++ b/tests/spec/glsl-1.40/uniform_buffer/fs-saturated-vec-array.shader_test
@@ -0,0 +1,42 @@
+[require]
+GLSL >= 1.40
+
+[vertex shader]
+#version 140
+
+in vec4 vertex;
+
+void main()
+{
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#version 140
+
+/* On i965, the instruction for loading from a UBO array is likely to
+ * encounter trouble with the saturate flag produced by this clamping.
+ */
+uniform int i;
+uniform ubo1 {
+ vec4 color[2];
+};
+
+void main()
+{
+ gl_FragColor = 0.25 + 0.5 * clamp(color[i], 0.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform int i 1
+uniform vec4 color[0] 0.5 0.5 0.5 0.5
+uniform vec4 color[1] -1 0 1 2
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.25 0.25 0.75 0.75
--
1.7.10.4
More information about the Piglit
mailing list