[Piglit] [PATCH] Add a test for ARB_shader_bit_encoding.

Olivier Galibert galibert at pobox.com
Mon Apr 30 04:35:15 PDT 2012


The test passes with the nvidia blob and softpipe with the appropriate
patches in Mesa.

I'm not in love with the file name.

Signed-off-by: Olivier Galibert <galibert at pobox.com>
---
 .../execution/bitwise-convert.shader_test          |   36 ++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 tests/spec/glsl-1.30/execution/bitwise-convert.shader_test

diff --git a/tests/spec/glsl-1.30/execution/bitwise-convert.shader_test b/tests/spec/glsl-1.30/execution/bitwise-convert.shader_test
new file mode 100644
index 0000000..5c94e5d
--- /dev/null
+++ b/tests/spec/glsl-1.30/execution/bitwise-convert.shader_test
@@ -0,0 +1,36 @@
+# Test proper behavior of the ARB_shader_bit_encoding extension, which
+# is also natively part of GLSL 3.3
+#
+
+[require]
+GLSL >= 1.30
+
+[vertex shader]
+#version 130
+#extension GL_ARB_shader_bit_encoding : require
+uniform vec2 value;
+flat out int val1;
+flat out uint val2;
+void main()
+{
+  val1 = floatBitsToInt(value.x);
+  val2 = floatBitsToUint(value.y);
+  gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+#version 130
+#extension GL_ARB_shader_bit_encoding : require
+
+flat in int val1;
+flat in uint val2;
+
+void main()
+{
+  gl_FragColor = vec4(intBitsToFloat(val1), uintBitsToFloat(val2), 0.0, 1.0);
+}
+
+[test]
+uniform vec2 value 0.125 0.25
+draw rect -1 -1 2 2
+probe rgba 0 0 0.125 0.25 0.0 1.0
-- 
1.7.10.rc3.1.gb306





More information about the Piglit mailing list