summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-11-09 14:27:45 -0800
committerEric Anholt <eric@anholt.net>2012-11-26 14:37:06 -0800
commit0fa0d48891208380379c0b78318841e9b85c202a (patch)
treecfc796ec48520d561dc837832a8f998929565b7a
parent13205de1384b918483fdda0d6a8d9fecb1bf4027 (diff)
glsl-1.40: Add a new UBO test for a potential bug in the i965 driver.
-rw-r--r--tests/spec/glsl-1.40/uniform_buffer/fs-saturated-vec-array.shader_test42
1 files changed, 42 insertions, 0 deletions
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 00000000..d5408789
--- /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