[Piglit] [PATCH] arb_gpu_shader_fp64: simple double varyings test on GL4.4

Timothy Arceri timothy.arceri at collabora.com
Thu May 26 03:08:33 UTC 2016


---
 .../execution/vs-fs-packing-gl4.4.shader_test      | 76 ++++++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/vs-fs-packing-gl4.4.shader_test

diff --git a/tests/spec/arb_gpu_shader_fp64/execution/vs-fs-packing-gl4.4.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/vs-fs-packing-gl4.4.shader_test
new file mode 100644
index 0000000..a3059e4
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/vs-fs-packing-gl4.4.shader_test
@@ -0,0 +1,76 @@
+# Varying packing in Mesa is disabled in GL4.4+ as there is no guarantee
+# interpolation qualifiers will match across shaders. For doubles this
+# shouldn't matter as fs inputs must always be qualified as flat.
+# This is a simple test to check that backends or the packing pass (depending
+# on the chosen solution) correctly handle doubles in GL4.4+.
+
+[require]
+GLSL >= 4.40
+
+[vertex shader]
+#version 440
+
+flat out dvec2 dv1;
+out dvec2 dv2;
+flat out dvec2 dv3;
+out dvec2 dv4;
+
+flat out double d1;
+out double d2;
+flat out double d3;
+out double d4;
+
+in vec4 piglit_vertex;
+
+void main()
+{
+  gl_Position = piglit_vertex;
+
+  dv1 = dvec2(1.0, 0.0);
+  dv2 = dvec2(0.0, 1.0);
+  dv3 = dvec2(0.0, 0.0);
+  dv4 = dvec2(1.0, 1.0);
+
+  d1 = 0.25LF;
+  d2 = 0.50LF;
+  d3 = 0.75LF;
+  d4 = 1.00LF;
+}
+
+[fragment shader]
+#version 440
+
+flat in dvec2 dv1;
+flat in dvec2 dv2;
+flat in dvec2 dv3;
+flat in dvec2 dv4;
+
+flat in double d1;
+flat in double d2;
+flat in double d3;
+flat in double d4;
+
+out vec4 color;
+
+void main()
+{
+  if ((dvec2(1.0, 0.0) == dv1) &&
+      (dvec2(0.0, 1.0) == dv2) &&
+      (dvec2(0.0, 0.0) == dv3) &&
+      (dvec2(1.0, 1.0) == dv4) &&
+      (0.25LF == d1) &&
+      (0.50LF == d2) &&
+      (0.75LF == d3) &&
+      (1.00LF == d4)) {
+    color = vec4(1.0, 0.0, 1.0, 1.0);
+    return;
+  }
+
+  color = vec4(0.0, 0.0, 1.0, 1.0);
+}
+
+[test]
+clear color 0.1 0.1 0.1 0.1
+clear
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.0 1.0 1.0
-- 
2.5.5



More information about the Piglit mailing list