[Piglit] [PATCH] glsl-1.10: test bug with lessThan() with input expression has mixed sizes

Timothy Arceri tarceri at itsqueeze.com
Wed Jun 27 11:38:47 UTC 2018


---
 ...on-vec4-mixed-arithmetic-input.shader_test | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 tests/spec/glsl-1.10/execution/comparision-vec4-mixed-arithmetic-input.shader_test

diff --git a/tests/spec/glsl-1.10/execution/comparision-vec4-mixed-arithmetic-input.shader_test b/tests/spec/glsl-1.10/execution/comparision-vec4-mixed-arithmetic-input.shader_test
new file mode 100644
index 000000000..78f0068a3
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/comparision-vec4-mixed-arithmetic-input.shader_test
@@ -0,0 +1,37 @@
+# This exerises a bug found in a Doom shader were the lessThan() comparision
+# was only done againsts a single component of the mixed arithmetic expression
+# rather than all four components.
+
+[require]
+GLSL >= 1.10
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 110
+
+uniform vec4 a;
+uniform vec4 b;
+
+void main() {
+	gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+
+	if (any(lessThan(b.w + a.xyzw, vec4(0.0))))
+		gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.1 0.1 0.1 0.1
+clear
+
+uniform vec4 a 0.5 0.5 0.5 -1.0
+uniform vec4 b 1.0 1.0 1.0 0.5
+draw rect -1 -1 2 2
+
+probe all rgba 1.0 0.0 0.0 1.0
+
+uniform vec4 a 0.5 0.5 0.5 -0.5
+uniform vec4 b 1.0 1.0 1.0 0.5
+draw rect -1 -1 2 2
+
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.17.1



More information about the Piglit mailing list