[Piglit] [PATCH 2/6] arb_gpu_shader_fp64: add packDouble2x32 and unpackDouble2x32 tests
Dave Airlie
airlied at gmail.com
Wed Jul 23 15:56:53 PDT 2014
From: Dave Airlie <airlied at redhat.com>
Simple tests to make sure the packing is correct.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
.../fs-packDouble2x32.shader_test | 50 ++++++++++++++++++++++
.../fs-unpackDouble2x32.shader_test | 50 ++++++++++++++++++++++
2 files changed, 100 insertions(+)
create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-packDouble2x32.shader_test
create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-unpackDouble2x32.shader_test
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-packDouble2x32.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-packDouble2x32.shader_test
new file mode 100644
index 0000000..70d9234
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-packDouble2x32.shader_test
@@ -0,0 +1,50 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+in vec4 vertex;
+
+void main() {
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64 : enable
+
+out vec4 color;
+
+uniform double expected_doub;
+uniform uvec2 given_uval;
+
+void main()
+{
+ /* Green if both pass. */
+ color = vec4(0.0, 1.0, 0.0, 1.0);
+
+ double packval;
+
+ packval = packDouble2x32(given_uval);
+
+ if (packval != expected_doub) {
+ color.r = 1.0;
+ }
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform double expected_doub 0.0
+uniform uvec2 given_uval 0 0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
+
+uniform double expected_doub 1.5
+uniform uvec2 given_uval 0 1073217536
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 1 0 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-unpackDouble2x32.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-unpackDouble2x32.shader_test
new file mode 100644
index 0000000..c6d4a6f
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-unpackDouble2x32.shader_test
@@ -0,0 +1,50 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+in vec4 vertex;
+
+void main() {
+ gl_Position = vertex;
+}
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64 : enable
+
+out vec4 color;
+
+uniform double given_doub;
+uniform uvec2 expected_uval;
+
+void main()
+{
+ /* Green if both pass. */
+ color = vec4(0.0, 1.0, 0.0, 1.0);
+
+ uvec2 packval;
+
+ packval = unpackDouble2x32(given_doub);
+
+ if (packval != expected_uval) {
+ color.r = 1.0;
+ }
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0 1.0
+-1.0 1.0
+
+[test]
+uniform double given_doub 0.0
+uniform uvec2 expected_uval 0 0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
+
+uniform double given_doub 1.5
+uniform uvec2 expected_uval 0 1073217536
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 1 0 0.0 1.0 0.0 1.0
--
1.8.5.3
More information about the Piglit
mailing list