[Piglit] [PATCH] arb_tessellation_shader/arb_gpu_shader_fp64: pass a dvec3

Dave Airlie airlied at gmail.com
Mon Dec 7 16:07:34 PST 2015


From: Dave Airlie <airlied at redhat.com>

This passes a dvec3 through vs->tcs->tes->fs.

This hits a bug in the glsl->tgsi code.
---
 .../execution/dvec3-vs-tcs-tes.shader_test         | 79 ++++++++++++++++++++++
 1 file changed, 79 insertions(+)
 create mode 100644 tests/spec/arb_tessellation_shader/execution/dvec3-vs-tcs-tes.shader_test

diff --git a/tests/spec/arb_tessellation_shader/execution/dvec3-vs-tcs-tes.shader_test b/tests/spec/arb_tessellation_shader/execution/dvec3-vs-tcs-tes.shader_test
new file mode 100644
index 0000000..98110c9
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/dvec3-vs-tcs-tes.shader_test
@@ -0,0 +1,79 @@
+# simple dvec3 through vs->tcs->tes->fs.
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#extension GL_ARB_gpu_shader_fp64: require
+in vec4 vertex;
+
+out dvec3 vs_var0;
+
+void main()
+{
+	gl_Position = vertex;
+	vs_var0 = dvec3(1.0LF, 2.0LF, 3.0LF);
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(vertices = 3) out;
+
+in dvec3 vs_var0[];
+out dvec3 tcs_var0[];
+
+void main() {
+	gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
+	gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0);
+	gl_TessLevelInner = float[2](0.0, 0.0);
+	tcs_var0[gl_InvocationID] = vs_var0[gl_InvocationID] + dvec3(2.0LF, 3.0LF, 4.0LF);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(triangles) in;
+
+in dvec3 tcs_var0[];
+flat out dvec3 tes_var0;
+
+void main() {
+	gl_Position = gl_in[0].gl_Position * gl_TessCoord[0]
+	            + gl_in[1].gl_Position * gl_TessCoord[1]
+	            + gl_in[2].gl_Position * gl_TessCoord[2];
+
+	tes_var0 = tcs_var0[0] + dvec3(3.0LF, 4.0LF, 5.0LF);
+}
+
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64: require
+flat in dvec3 tes_var0;
+
+void main()
+{
+	if (tes_var0 == dvec3(6.0LF, 9.0LF, 12.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
+ 1.0 -1.0
+ 1.0  1.0
+
+[test]
+clear color 0.1 0.1 0.1 0.1
+clear
+patch parameter vertices 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.5.0



More information about the Piglit mailing list