This ensures that the bitcasting functions are available in 3.30 without
having to use #extension GL_ARB_shader_bit_encoding: require.

Serious functional testing of those functions is left to Matt's thorough
generated tests for the GL_ARB_shader_bit_encoding extension.

Signed-off-by: Kenneth Graunke <[email protected]>
---
 .../shader-bit-encoding-coverage.shader_test       | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 
tests/spec/glsl-3.30/execution/shader-bit-encoding-coverage.shader_test

diff --git 
a/tests/spec/glsl-3.30/execution/shader-bit-encoding-coverage.shader_test 
b/tests/spec/glsl-3.30/execution/shader-bit-encoding-coverage.shader_test
new file mode 100644
index 0000000..152203e
--- /dev/null
+++ b/tests/spec/glsl-3.30/execution/shader-bit-encoding-coverage.shader_test
@@ -0,0 +1,44 @@
+# In GLSL 3.30, ARB_shader_bit_encoding functionality is now part of the main
+# spec, so shaders no longer have to enable the extension.  This essentially
+# just checks that all the functions are there, but leaves the real testing
+# to the extension tests.
+#
+[require]
+GLSL >= 3.30
+
+[vertex shader]
+#version 330
+
+in vec4 vertex;
+
+out float v;
+
+void main()
+{
+    v = uintBitsToFloat(floatBitsToUint(intBitsToFloat(floatBitsToInt(0.3))));
+    gl_Position = vertex;
+}
+
+[fragment shader]
+#version 330
+
+in float v;
+
+void main()
+{
+    float f;
+    f = uintBitsToFloat(floatBitsToUint(intBitsToFloat(floatBitsToInt(0.7))));
+    gl_FragColor = vec4(0.0, f + v, 0.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.8.3.4

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to