summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2017-01-05 23:33:55 +1100
committerTimothy Arceri <timothy.arceri@collabora.com>2017-01-07 21:50:53 +1100
commit462f8334099d9906824e1d0a2f67ba8dd203b3ba (patch)
treefc1ddb025d430c5f4662a9c966e06391c80e4427
parent6d4c5aadcc99fe885eae61182459577b5a2b26c8 (diff)
glsl-1.10: test 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-max-max-max.shader_test32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.10/execution/fs-max-max-max.shader_test b/tests/spec/glsl-1.10/execution/fs-max-max-max.shader_test
new file mode 100644
index 000000000..47e050018
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/fs-max-max-max.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 = max(a, 0.35);
+ b = max(b, 0.35);
+
+ float c = max(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.1
+uniform float u2 0.1
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 0.35 0.0 1.0