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

diff --git 
a/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-findLSB.shader_test
 
b/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-findLSB.shader_test
new file mode 100644
index 0000000..049433c
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-findLSB.shader_test
@@ -0,0 +1,67 @@
+[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) != findLSB(ivec4(0)))
+               /* Red if findLSB(ivec4) fails. */
+               color = vec4(1.0, 0.0, 0.0, 1.0);
+       else if (ivec4(-1) != findLSB(uvec4(0u)))
+               /* Blue if findLSB(uvec4) fails. */
+               color = vec4(0.0, 0.0, 1.0, 1.0);
+
+       if (ivec4(0, 1, 0, 2) != findLSB(ivec4(1, 2, 3, 4)))
+               /* Red if findLSB(ivec4) fails. */
+               color = vec4(1.0, 0.0, 0.0, 1.0);
+       else if (ivec4(0, 1, 0, 2) != findLSB(uvec4(1u, 2u, 3u, 4u)))
+               /* Blue if findLSB(uvec4) fails. */
+               color = vec4(0.0, 0.0, 1.0, 1.0);
+
+       if (ivec4(10, 9, 8, 7) != findLSB(ivec4(1024, 512, 256, 128)))
+               /* Red if findLSB(ivec4) fails. */
+               color = vec4(1.0, 0.0, 0.0, 1.0);
+       else if (ivec4(10, 9, 8, 7) != findLSB(uvec4(1024u, 512u, 256u, 128u)))
+               /* Blue if findLSB(uvec4) fails. */
+               color = vec4(0.0, 0.0, 1.0, 1.0);
+
+       if (ivec4(0, 1, 0, 2) != findLSB(ivec4(-1, -2, -3, -4)))
+               /* Red if findLSB(ivec4) fails. */
+               color = vec4(1.0, 0.0, 0.0, 1.0);
+       else if (ivec4(0, 1, 0, 2) != findLSB(uvec4(0xFFFFFFFFu, 0xFFFFFFFEu, 
0xFFFFFFFDu, 0xFFFFFFFCu)))
+               /* Blue if findLSB(uvec4) fails. */
+               color = vec4(0.0, 0.0, 1.0, 1.0);
+
+       if (ivec4(31, 30, 29, 28) != findLSB(ivec4(-2147483648, 1073741824, 
536870912, 268435456)))
+               /* Red if findLSB(ivec4) fails. */
+               color = vec4(1.0, 0.0, 0.0, 1.0);
+       else if (ivec4(31, 30, 29, 28) != findLSB(uvec4(0x80000000u, 
0x40000000u, 0x20000000u, 0x10000000u)))
+               /* Blue if findLSB(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

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to