summaryrefslogtreecommitdiff
path: root/tests/spec/glsl-1.10/execution/cmod-cmp-to-add-g.shader_test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/spec/glsl-1.10/execution/cmod-cmp-to-add-g.shader_test')
-rw-r--r--tests/spec/glsl-1.10/execution/cmod-cmp-to-add-g.shader_test30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.10/execution/cmod-cmp-to-add-g.shader_test b/tests/spec/glsl-1.10/execution/cmod-cmp-to-add-g.shader_test
new file mode 100644
index 000000000..8f116c7b4
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/cmod-cmp-to-add-g.shader_test
@@ -0,0 +1,30 @@
+# Test case reproduces mesa#2610. On Intel GPUs, the ordering of .sat
+# destination modifier and flag generation were handled backwards.
+
+[require]
+GLSL >= 1.10
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 110
+
+uniform float uni_val;
+
+void main()
+{
+ float val = 0.0;
+ val = clamp(uni_val - 10.0, 0.0, 1.0);
+
+ if (uni_val > 10.0)
+ val = 1.0;
+
+ gl_FragColor = vec4(val, 1.0 - val, 0.0, 1.0);
+}
+
+[test]
+uniform float uni_val 5.0
+clear color 0.5 0.5 0.5 0.5
+clear
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0