[Piglit] [PATCH] arb_gpu_shader_fp64: test passing an array from vs->gs->fs works.

Dave Airlie airlied at gmail.com
Sun Oct 11 21:49:50 PDT 2015


From: Dave Airlie <airlied at redhat.com>

This adds two variants on the same basic test, passing
an array of values from vs->gs->fs. The second variant
just initialised the array from 64-bit attributes.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 .../execution/gs-fs-vs-double-array.shader_test    | 73 ++++++++++++++++++++
 .../gs-fs-vs-attrib-double-array.shader_test       | 77 ++++++++++++++++++++++
 2 files changed, 150 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/gs-fs-vs-double-array.shader_test
 create mode 100644 tests/spec/arb_vertex_attrib_64bit/execution/gs-fs-vs-attrib-double-array.shader_test

diff --git a/tests/spec/arb_gpu_shader_fp64/execution/gs-fs-vs-double-array.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/gs-fs-vs-double-array.shader_test
new file mode 100644
index 0000000..99eeb79
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_fp64/execution/gs-fs-vs-double-array.shader_test
@@ -0,0 +1,73 @@
+# test passing a double array from vs->gs->fs works.
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+in vec4 vertex;
+
+out VS {
+	vec4 vs_vertex;
+	double vs_var0[2];
+};
+
+void main()
+{
+        vs_vertex = vertex;
+	vs_var0[0] = 1.0LF;
+	vs_var0[1] = 2.0LF;
+}
+
+[geometry shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+in VS {
+	vec4 vs_vertex;
+	double vs_var0[2];
+} inp[3];
+
+out GS {
+	flat double gs_var0[2];
+};
+
+void main()
+{
+	for (int i = 0; i < 3; i++) {
+		gl_Position = inp[i].vs_vertex;
+		gs_var0[0] = inp[i].vs_var0[0] + 3.0LF;
+		gs_var0[1] = inp[i].vs_var0[1] + 4.0LF;
+ 	        EmitVertex();
+        }
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+in GS {
+	flat double gs_var0[2];
+};
+
+void main()
+{
+  if (gs_var0[0] == 4.0LF && gs_var0[1] == 6.0LF)
+     gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+  else
+     gl_FragColor = 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]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_vertex_attrib_64bit/execution/gs-fs-vs-attrib-double-array.shader_test b/tests/spec/arb_vertex_attrib_64bit/execution/gs-fs-vs-attrib-double-array.shader_test
new file mode 100644
index 0000000..e20fe9e
--- /dev/null
+++ b/tests/spec/arb_vertex_attrib_64bit/execution/gs-fs-vs-attrib-double-array.shader_test
@@ -0,0 +1,77 @@
+# test passing a double array from vs->gs->fs works.
+# this variant inputs values from vertex varyings w
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+GL_ARB_vertex_attrib_64bit
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+#extension GL_ARB_vertex_attrib_64bit : require
+in dvec2 values;
+in vec4 vertex;
+
+out VS {
+	vec4 vs_vertex;
+	double vs_var0[2];
+};
+
+void main()
+{
+        vs_vertex = vertex;
+	vs_var0[0] = values.x;
+	vs_var0[1] = values.y;
+}
+
+[geometry shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+in VS {
+	vec4 vs_vertex;
+	double vs_var0[2];
+} inp[3];
+
+out GS {
+	flat double gs_var0[2];
+};
+
+void main()
+{
+	for (int i = 0; i < 3; i++) {
+		gl_Position = inp[i].vs_vertex;
+		gs_var0[0] = inp[i].vs_var0[0] + 3.0LF;
+		gs_var0[1] = inp[i].vs_var0[1] + 4.0LF;
+ 	        EmitVertex();
+        }
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+
+in GS {
+	flat double gs_var0[2];
+};
+
+void main()
+{
+  if (gs_var0[0] == 5.0LF && gs_var0[1] == 7.0LF)
+     gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+  else
+     gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2 values/double/2
+-1.0 -1.0 2.0 3.0
+ 1.0 -1.0 2.0 3.0
+ 1.0  1.0 2.0 3.0
+-1.0  1.0 2.0 3.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0
-- 
2.4.3



More information about the Piglit mailing list