[Piglit] [PATCH 07/19] arb_gpu_shader5: Add a vertex shader bitCount execution test.
Matt Turner
mattst88 at gmail.com
Mon Apr 22 16:56:03 PDT 2013
---
.../built-in-functions/vs-bitCount.shader_test | 74 ++++++++++++++++++++
1 files changed, 74 insertions(+), 0 deletions(-)
create mode 100644 tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-bitCount.shader_test
diff --git a/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-bitCount.shader_test b/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-bitCount.shader_test
new file mode 100644
index 0000000..a3a0db5
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/built-in-functions/vs-bitCount.shader_test
@@ -0,0 +1,74 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader]
+#extension GL_ARB_gpu_shader5 : enable
+
+in vec4 vertex;
+out vec4 color;
+
+uniform ivec4 bits;
+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 (bits != bitCount(iinput))
+ /* Red if bitCount(ivec4) fails. */
+ color = vec4(1.0, 0.0, 0.0, 1.0);
+ else if (bits != bitCount(uinput))
+ /* Blue if bitCount(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]
+uniform ivec4 bits 0 0 0 0
+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 bits 1 1 1 1
+uniform ivec4 iinput 1 2 4 8
+uniform uvec4 uinput 1 2 4 8
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform ivec4 bits 1 2 3 4
+uniform ivec4 iinput 1 3 7 15
+uniform uvec4 uinput 1 3 7 15
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform ivec4 bits 6 6 3 5
+uniform ivec4 iinput 783 111 385 484
+uniform uvec4 uinput 783 111 385 484
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform ivec4 bits 32 31 31 30
+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
--
1.7.8.6
More information about the Piglit
mailing list