[Piglit] [PATCH] arb_gpu_shader_fp64: add some tests for indirect double accesses

Dave Airlie airlied at gmail.com
Mon Jun 29 18:40:49 PDT 2015


From: Dave Airlie <airlied at redhat.com>

while developing for llvmpipe, I realised we weren't testing
indirect access to double arrays, so I wrote some tests.

double array temp src
double array temp dst
double array constant src.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 .../fs-indirect-temp-double-const-src.shader_test  | 50 ++++++++++++++++++++++
 .../fs-indirect-temp-double-dst.shader_test        | 43 +++++++++++++++++++
 .../fs-indirect-temp-double-src.shader_test        | 50 ++++++++++++++++++++++
 3 files changed, 143 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-const-src.shader_test
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-dst.shader_test
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-src.shader_test

diff --git a/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-const-src.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-const-src.shader_test
new file mode 100644
index 0000000..7cf4d70
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-const-src.shader_test
@@ -0,0 +1,50 @@
+# test indirect access to an array of constant doubles
+[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 : require
+uniform double arg0;
+uniform double tval[5];
+uniform double tolerance;
+uniform double expected;
+uniform int pick;
+void main()
+{
+  double result;
+  result = (tval[pick] + arg0);
+  gl_FragColor = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 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]
+clear color 0.0 0.0 1.0 0.0
+clear
+uniform double tval[0] 0.0
+uniform double tval[1] 0.25
+uniform double tval[2] 0.5
+uniform double tval[3] 0.75
+uniform double arg0 0.25
+uniform double expected 0.75
+uniform double tolerance 0.0
+uniform int pick 2
+draw arrays GL_TRIANGLE_FAN 0 4
+uniform double arg0 0.25
+uniform double expected 0.5
+uniform double tolerance 0.0
+uniform int pick 1
+draw arrays GL_TRIANGLE_FAN 0 4
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-dst.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-dst.shader_test
new file mode 100644
index 0000000..e620e9d
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-dst.shader_test
@@ -0,0 +1,43 @@
+# test indirect access to an array of doubles as a dst.
+[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 : require
+uniform double arg0;
+uniform double arg1;
+uniform double tolerance;
+uniform double expected;
+uniform int pick;
+void main()
+{
+  double result[5];
+
+  result[pick] = (arg0 + arg1);
+  gl_FragColor = distance(result[pick], expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 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]
+clear color 0.0 0.0 1.0 0.0
+clear
+uniform double arg0 0.5
+uniform double arg1 0.25
+uniform double expected 0.75
+uniform double tolerance 0.0
+uniform int pick 3
+draw arrays GL_TRIANGLE_FAN 0 4
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-src.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-src.shader_test
new file mode 100644
index 0000000..2f50c63
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-src.shader_test
@@ -0,0 +1,50 @@
+# test indirect access to a temporary array of doubles as a source
+[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 : require
+uniform double arg0;
+uniform double tolerance;
+uniform double expected;
+uniform int pick;
+void main()
+{
+  double tval[5];
+  double result;
+  tval[0] = 0.0lf;
+  tval[1] = 0.25lf;
+  tval[2] = 0.5lf;
+  tval[3] = 0.75lf;
+  result = (tval[pick] + arg0);
+  gl_FragColor = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 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]
+clear color 0.0 0.0 1.0 0.0
+clear
+uniform double arg0 0.25
+uniform double expected 0.75
+uniform double tolerance 0.0
+uniform int pick 2
+draw arrays GL_TRIANGLE_FAN 0 4
+uniform double arg0 0.25
+uniform double expected 0.5
+uniform double tolerance 0.0
+uniform int pick 1
+draw arrays GL_TRIANGLE_FAN 0 4
-- 
2.4.3



More information about the Piglit mailing list