aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2017-01-06 10:20:16 +1100
committerTimothy Arceri <timothy.arceri@collabora.com>2017-01-07 21:51:02 +1100
commit1cb06d422c1c0ad6556806b02d54cb46a3ff34c1 (patch)
tree4ae85cec49f09bfbacb5a56e35cfd6aa0cc19881
parent462f8334099d9906824e1d0a2f67ba8dd203b3ba (diff)
downloadpiglit-1cb06d422c1c0ad6556806b02d54cb46a3ff34c1.tar.gz
glsl-1.10: another test for min max optimisation pass
This simple test exposes a bug in the GLSL IR optimisation pass in Mesa master. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
-rw-r--r--tests/spec/glsl-1.10/execution/fs-min-min-min.shader_test32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.10/execution/fs-min-min-min.shader_test b/tests/spec/glsl-1.10/execution/fs-min-min-min.shader_test
new file mode 100644
index 000000000..35ddeb9c5
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/fs-min-min-min.shader_test
@@ -0,0 +1,32 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader passthrough]
+
+[fragment shader]
+
+uniform float u;
+uniform float u2;
+
+void main()
+{
+ float a = u;
+ float b = u2;
+
+ a = min(a, 0.35);
+ b = min(b, 0.35);
+
+ float c = min(a, b);
+
+ gl_FragColor = vec4(0.0, c, 0.0, 1.0);
+}
+
+[test]
+clear color 0.2 0.2 0.2 0.2
+clear
+
+uniform float u 0.75
+uniform float u2 0.75
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 0.35 0.0 1.0