[Piglit] [PATCH 18/19] arb_gpu_shader5: Add a constant eval bitfieldInsert execution test.

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


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

diff --git a/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-bitfieldInsert.shader_test b/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-bitfieldInsert.shader_test
new file mode 100644
index 0000000..1321b17
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/built-in-functions/const-bitfieldInsert.shader_test
@@ -0,0 +1,56 @@
+[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(42, 56, 72, 97) != bitfieldInsert(ivec4(42, 56, 72, 97), ivec4(2147483647, 15, 7, 3), 0, 0))
+		/* Red if bitfieldInsert(ivec4, ...) fails. */
+		color = vec4(1.0, 0.0, 0.0, 1.0);
+
+	if (uvec4(42u, 56u, 72u, 97u) != bitfieldInsert(uvec4(42u, 56u, 72u, 97u), uvec4(0xFFFFFFFFu, 15u, 7u, 3u), 0, 0))
+		/* Blue if bitfieldInsert(uvec4, ...) fails. */
+		color = vec4(0.0, 0.0, 1.0, 1.0);
+
+	if (ivec4(589839, 262159, 65551, 15) != bitfieldInsert(ivec4(983055), ivec4(9, 4, 1, 0), 16, 4))
+		/* Red if bitfieldInsert(ivec4, ...) fails. */
+		color = vec4(1.0, 0.0, 0.0, 1.0);
+
+	if (uvec4(0x0009000Fu, 0x0004000Fu, 0x0001000Fu, 0x0000000Fu) != bitfieldInsert(uvec4(0x000F000Fu), uvec4(0x9u, 0x4u, 0x1u, 0x0u), 16, 4))
+		/* Blue if bitfieldInsert(uvec4, ...) fails. */
+		color = vec4(0.0, 0.0, 1.0, 1.0);
+
+	if (ivec4(917519, 589839, 262159, 65551) != bitfieldInsert(ivec4(15), ivec4(14, 9, 4, 1), 16, 4))
+		/* Red if bitfieldInsert(ivec4, ...) fails. */
+		color = vec4(1.0, 0.0, 0.0, 1.0);
+
+	if (uvec4(0x000E000Fu, 0x0009000Fu, 0x0004000Fu, 0x0001000Fu) != bitfieldInsert(uvec4(0xFu), uvec4(0xEu, 0x9u, 0x4u, 0x1u), 16, 4))
+		/* Blue if bitfieldInsert(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