[Piglit] [PATCH] tess/fp64: add some basic cross over tests
Dave Airlie
airlied at gmail.com
Wed Sep 30 01:20:21 PDT 2015
From: Dave Airlie <airlied at redhat.com>
CTS tests this a lot better than piglit, but this is a good place
to start, I've got a bunch of fixes queued for mesa to address
some of these problems.
This adds 3 tests:
simple double vs->tcs->tes->fs
simple dvec2 vs->tcs->tes->fs
simple double[2] vs->tcs->tes->fs
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
.../execution/double-array-vs-tcs-tes.shader_test | 98 ++++++++++++++++++++++
.../execution/double-vs-tcs-tes.shader_test | 80 ++++++++++++++++++
.../execution/dvec2-vs-tcs-tes.shader_test | 80 ++++++++++++++++++
3 files changed, 258 insertions(+)
create mode 100644 tests/spec/arb_tessellation_shader/execution/double-array-vs-tcs-tes.shader_test
create mode 100644 tests/spec/arb_tessellation_shader/execution/double-vs-tcs-tes.shader_test
create mode 100644 tests/spec/arb_tessellation_shader/execution/dvec2-vs-tcs-tes.shader_test
diff --git a/tests/spec/arb_tessellation_shader/execution/double-array-vs-tcs-tes.shader_test b/tests/spec/arb_tessellation_shader/execution/double-array-vs-tcs-tes.shader_test
new file mode 100644
index 0000000..da8397e
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/double-array-vs-tcs-tes.shader_test
@@ -0,0 +1,98 @@
+# simple double array 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 VS {
+ double vs_var0[2];
+};
+
+void main()
+{
+ gl_Position = vertex;
+ vs_var0[0] = 1.0LF;
+ vs_var0[1] = 2.0LF;
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(vertices = 3) out;
+
+in VS {
+ double vs_var0[2];
+} inp[];
+
+out TCS {
+ double tcs_var0[2];
+} outp[];
+
+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);
+ outp[gl_InvocationID].tcs_var0[0] = inp[gl_InvocationID].vs_var0[0] + 2.0LF;
+ outp[gl_InvocationID].tcs_var0[1] = inp[gl_InvocationID].vs_var0[1] + 3.0LF;
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(triangles) in;
+
+in TCS {
+ double tcs_var0[2];
+} inp[];
+
+out TES {
+ flat double tes_var0[2];
+};
+
+void main() {
+ dvec2 temp;
+ 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[0] = inp[0].tcs_var0[0] + 3.0LF;
+ tes_var0[1] = inp[0].tcs_var0[1] + 4.0LF;
+}
+
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64: require
+in TES {
+ flat double tes_var0[2];
+};
+
+void main()
+{
+ if (tes_var0[0] == 6.0LF && tes_var0[1] == 9.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
diff --git a/tests/spec/arb_tessellation_shader/execution/double-vs-tcs-tes.shader_test b/tests/spec/arb_tessellation_shader/execution/double-vs-tcs-tes.shader_test
new file mode 100644
index 0000000..68d73dc
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/double-vs-tcs-tes.shader_test
@@ -0,0 +1,80 @@
+# simple double 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 double vs_var0;
+
+void main()
+{
+ gl_Position = vertex;
+ vs_var0 = 1.0LF;
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(vertices = 3) out;
+
+in double vs_var0[];
+out double 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] + 2.0LF;
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(triangles) in;
+
+in double tcs_var0[];
+flat out double tes_var0;
+
+void main() {
+ dvec2 temp;
+ 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] + 3.0LF;
+}
+
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64: require
+flat in double tes_var0;
+
+void main()
+{
+ if (tes_var0 == 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
+ 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
diff --git a/tests/spec/arb_tessellation_shader/execution/dvec2-vs-tcs-tes.shader_test b/tests/spec/arb_tessellation_shader/execution/dvec2-vs-tcs-tes.shader_test
new file mode 100644
index 0000000..90eb9f9
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/dvec2-vs-tcs-tes.shader_test
@@ -0,0 +1,80 @@
+# simple dvec2 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 dvec2 vs_var0;
+
+void main()
+{
+ gl_Position = vertex;
+ vs_var0 = dvec2(1.0LF, 2.0LF);
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(vertices = 3) out;
+
+in dvec2 vs_var0[];
+out dvec2 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] + dvec2(2.0LF, 3.0LF);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(triangles) in;
+
+in dvec2 tcs_var0[];
+flat out dvec2 tes_var0;
+
+void main() {
+ dvec2 temp;
+ 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] + dvec2(3.0LF, 4.0LF);
+}
+
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64: require
+flat in dvec2 tes_var0;
+
+void main()
+{
+ if (tes_var0 == dvec2(6.0LF, 9.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