[Piglit] [PATCH 10/19] arb_gpu_shader5: Add a vertex shader findLSB execution test.

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


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

diff --git a/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-findLSB.shader_test b/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-findLSB.shader_test
new file mode 100644
index 0000000..4522cfd
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-findLSB.shader_test
@@ -0,0 +1,75 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader]
+#extension GL_ARB_gpu_shader5 : enable
+
+in vec4 vertex;
+out vec4 color;
+
+uniform ivec4 lsb;
+uniform ivec4 iinput;
+uniform uvec4 uinput;
+
+void main() {
+	gl_Position = vertex;
+
+	/* Green if both pass. */
+	color = vec4(0.0, 1.0, 0.0, 1.0);
+
+	if (lsb != findLSB(iinput))
+		/* Red if findLSB(ivec4) fails. */
+		color = vec4(1.0, 0.0, 0.0, 1.0);
+	else if (lsb != findLSB(uinput))
+		/* Blue if findLSB(uvec4) fails. */
+		color = vec4(0.0, 0.0, 1.0, 1.0);
+}
+
+[fragment shader]
+in vec4 color;
+out vec4 frag_color;
+
+void main()
+{
+	frag_color = color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+# If value is zero, -1 will be returned.
+uniform ivec4 lsb -1 -1 -1 -1
+uniform ivec4 iinput 0 0 0 0
+uniform uvec4 uinput 0 0 0 0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform ivec4 lsb 0 1 0 2
+uniform ivec4 iinput 1 2 3 4
+uniform uvec4 uinput 1 2 3 4
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform ivec4 lsb 10 9 8 7
+uniform ivec4 iinput 1024 512 256 128
+uniform uvec4 uinput 1024 512 256 128
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform ivec4 lsb 0 1 0 2
+uniform ivec4 iinput -1 -2 -3 -4
+uniform uvec4 uinput 0xFFFFFFFF 0xFFFFFFFE 0xFFFFFFFD 0xFFFFFFFC
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform ivec4 lsb 31 30 29 28
+uniform ivec4 iinput -2147483648 1073741824 536870912 268435456
+uniform uvec4 uinput 0x80000000 0x40000000 0x20000000 0x10000000
+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