[Piglit] [PATCH 15/19] arb_gpu_shader5: Add a constant eval findMSB execution test.

Matt Turner mattst88 at gmail.com
Mon Apr 22 16:56:11 PDT 2013


---
 .../built-in-functions/const-findMSB.shader_test   |   64 ++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/arb_gpu_shader5/execution/built-in-functions/const-findMSB.shader_test

diff --git a/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-findMSB.shader_test b/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-findMSB.shader_test
new file mode 100644
index 0000000..d3682d9
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-findMSB.shader_test
@@ -0,0 +1,64 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader]
+in vec4 vertex;
+
+void main() {
+	gl_Position = vertex;
+}
+
+[fragment shader]
+#extension GL_ARB_gpu_shader5 : enable
+
+out vec4 color;
+
+void main()
+{
+	/* Green if both pass. */
+	color = vec4(0.0, 1.0, 0.0, 1.0);
+
+	if (ivec4(-1) != findMSB(ivec4(0, -1, -1, 0)))
+		/* Red if findMSB(ivec4) fails. */
+		color = vec4(1.0, 0.0, 0.0, 1.0);
+
+	if (ivec4(-1) != findMSB(uvec4(0u)))
+		/* Blue if findMSB(uvec4) fails. */
+		color = vec4(0.0, 0.0, 1.0, 1.0);
+
+	if (ivec4(31, 30, 30, 29) != findMSB(ivec4(1, 2, 3, 4)))
+		/* Red if findMSB(ivec4) fails. */
+		color = vec4(1.0, 0.0, 0.0, 1.0);
+
+	if (ivec4(1, 2, 3, 4) != findMSB(ivec4(2147483647, 1073741823, 536870911, 268435455)))
+		/* Red if findMSB(ivec4) fails. */
+		color = vec4(1.0, 0.0, 0.0, 1.0);
+
+	if (ivec4(31, 30, 29, 28) != findMSB(ivec4(-2, -3, -5, -9)))
+		/* Red if findMSB(ivec4) fails. */
+		color = vec4(1.0, 0.0, 0.0, 1.0);
+
+	if (ivec4(1, 1, 2, 3) != findMSB(ivec4(-2147483648, -1879048192, -1073741824, -536870912)))
+		/* Red if findMSB(ivec4) fails. */
+		color = vec4(1.0, 0.0, 0.0, 1.0);
+
+	if (ivec4(31, 30, 30, 29) != findMSB(uvec4(1u, 2u, 3u, 4u)))
+		/* Blue if findMSB(uvec4) fails. */
+		color = vec4(0.0, 0.0, 1.0, 1.0);
+
+	if (ivec4(0, 1, 2, 3) != findMSB(uvec4(0xFFFFFFFFu, 0x7FFFFFFFu, 0x3FFFFFFFu, 0x1FFFFFFFu)))
+		/* Blue if findMSB(uvec4) fails. */
+		color = vec4(0.0, 0.0, 1.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]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
-- 
1.7.8.6



More information about the Piglit mailing list