[Piglit] [PATCH] arb_gpu_shader_fp64: add simple explicit location execution test

Samuel Iglesias Gonsálvez siglesias at igalia.com
Tue May 31 06:22:41 UTC 2016


It is failing in current i965 Mesa driver. This tests checks
VS, GS and FS stages.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
---
 .../explicit-location-gs-fs-vs-double.shader_test  | 74 ++++++++++++++++++++++
 1 file changed, 74 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-fs-vs-double.shader_test

diff --git a/tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-fs-vs-double.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-fs-vs-double.shader_test
new file mode 100644
index 0000000..42a6994
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/explicit-location-gs-fs-vs-double.shader_test
@@ -0,0 +1,74 @@
+# test truncating a double holds precision using explicit locations.
+[require]
+GLSL >= 4.20
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 420
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform dvec4 arg0;
+
+in vec4 vertex;
+layout(location = 0) out vec4 vertex_to_gs;
+layout(location = 1) out dvec4 dout1_to_gs;
+
+void main()
+{
+	vertex_to_gs = vertex;
+	dout1_to_gs = arg0;
+}
+
+[geometry shader]
+#version 420
+#extension GL_ARB_gpu_shader_fp64 : require
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+layout(location = 0) in vec4 vertex_to_gs[3];
+layout(location = 1) in dvec4 dout1_to_gs[3];
+layout(location = 3) flat out dvec4 out_to_fs;
+
+void main()
+{
+	for (int i = 0; i < 3; i++) {
+		gl_Position = vertex_to_gs[i];
+		out_to_fs = dout1_to_gs[i];
+		EmitVertex();
+	}
+}
+
+[fragment shader]
+#version 420
+#extension GL_ARB_gpu_shader_fp64 : require
+
+uniform double tolerance;
+uniform dvec4 expected;
+
+layout(location = 3) flat in dvec4 out_to_fs;
+out vec4 color;
+
+void main()
+{
+	dvec4 result = trunc(out_to_fs);
+	color = distance(result, dvec4(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 0.0 0.0
+
+clear
+uniform dvec4 arg0 1.7976931348623157E+308 1.5 -1.5 -0.5
+uniform dvec4 expected 1.7976931348623157E+308 1.0 -1.0 0.0
+uniform double tolerance 2.0000000000000002e-05
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
-- 
2.7.4



More information about the Piglit mailing list