[Piglit] [PATCH] arb_tessellation_shader: add basic read/write variable indexing fp64 tests
Iago Toral Quiroga
itoral at igalia.com
Fri Jul 15 06:52:40 UTC 2016
---
.../tcs-input-array-dvec4-index-rd.shader_test | 99 ++++++++++++++++++++
.../tcs-output-array-dvec4-index-wr.shader_test | 97 +++++++++++++++++++
.../tes-input-array-dvec4-index-rd.shader_test | 93 +++++++++++++++++++
...put-array-dvec4-index-wr-before-tcs.shader_test | 103 +++++++++++++++++++++
4 files changed, 392 insertions(+)
create mode 100644 tests/spec/arb_tessellation_shader/execution/variable-indexing/tcs-input-array-dvec4-index-rd.shader_test
create mode 100644 tests/spec/arb_tessellation_shader/execution/variable-indexing/tcs-output-array-dvec4-index-wr.shader_test
create mode 100644 tests/spec/arb_tessellation_shader/execution/variable-indexing/tes-input-array-dvec4-index-rd.shader_test
create mode 100644 tests/spec/arb_tessellation_shader/execution/variable-indexing/vs-output-array-dvec4-index-wr-before-tcs.shader_test
diff --git a/tests/spec/arb_tessellation_shader/execution/variable-indexing/tcs-input-array-dvec4-index-rd.shader_test b/tests/spec/arb_tessellation_shader/execution/variable-indexing/tcs-input-array-dvec4-index-rd.shader_test
new file mode 100644
index 0000000..267bea2
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/variable-indexing/tcs-input-array-dvec4-index-rd.shader_test
@@ -0,0 +1,99 @@
+[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 block {
+ dvec4 vs_var0[4];
+} blk;
+
+void main()
+{
+ gl_Position = vertex;
+ blk.vs_var0[0] = dvec4(1.0LF, 0.0LF, 0.0LF, 1.0LF);
+ blk.vs_var0[1] = dvec4(0.0LF, 1.0LF, 0.0LF, 1.0LF);
+ blk.vs_var0[2] = dvec4(0.0LF, 0.0LF, 1.0LF, 1.0LF);
+ blk.vs_var0[3] = dvec4(1.0LF, 1.0LF, 0.0LF, 1.0LF);
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(vertices = 3) out;
+
+uniform int index;
+in block {
+ dvec4 vs_var0[4];
+} blk[];
+
+out vec4 color[];
+
+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);
+
+ color[gl_InvocationID] = vec4(blk[gl_InvocationID].vs_var0[index]);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(triangles) in;
+
+in vec4 color[];
+out vec4 fs_color;
+
+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];
+
+ fs_color = vec4(color[0]);
+}
+
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64: require
+in vec4 fs_color;
+
+void main()
+{
+ gl_FragColor = fs_color;
+}
+
+[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
+
+uniform int index 0
+draw arrays GL_PATCHES 0 6
+probe all rgba 1.0 0.0 0.0 1.0
+
+uniform int index 1
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform int index 2
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 0.0 1.0 1.0
+
+uniform int index 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 1.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_tessellation_shader/execution/variable-indexing/tcs-output-array-dvec4-index-wr.shader_test b/tests/spec/arb_tessellation_shader/execution/variable-indexing/tcs-output-array-dvec4-index-wr.shader_test
new file mode 100644
index 0000000..c4a52f8
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/variable-indexing/tcs-output-array-dvec4-index-wr.shader_test
@@ -0,0 +1,97 @@
+[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;
+
+void main()
+{
+ gl_Position = vertex;
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(vertices = 3) out;
+
+uniform int index;
+out block {
+ dvec4 tcs_var0[4];
+} blk[];
+
+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);
+
+ blk[gl_InvocationID].tcs_var0[0] = dvec4(0.0LF, 0.0LF, 0.0LF, 0.0LF);
+ blk[gl_InvocationID].tcs_var0[1] = dvec4(0.0LF, 0.0LF, 0.0LF, 0.0LF);
+ blk[gl_InvocationID].tcs_var0[2] = dvec4(0.0LF, 0.0LF, 0.0LF, 0.0LF);
+ blk[gl_InvocationID].tcs_var0[3] = dvec4(0.0LF, 0.0LF, 0.0LF, 0.0LF);
+ blk[gl_InvocationID].tcs_var0[index] = dvec4(0.0LF, 1.0LF, 0.0LF, 1.0LF);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(triangles) in;
+
+uniform int index;
+in block {
+ dvec4 tcs_var0[4];
+} blk[];
+
+out vec4 color;
+
+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];
+
+ color = vec4(blk[0].tcs_var0[index]);
+}
+
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64: require
+in vec4 color;
+
+void main()
+{
+ gl_FragColor = color;
+}
+
+[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
+
+uniform int index 0
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform int index 1
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform int index 2
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform int index 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/variable-indexing/tes-input-array-dvec4-index-rd.shader_test b/tests/spec/arb_tessellation_shader/execution/variable-indexing/tes-input-array-dvec4-index-rd.shader_test
new file mode 100644
index 0000000..724b6ac
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/variable-indexing/tes-input-array-dvec4-index-rd.shader_test
@@ -0,0 +1,93 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+in vec4 vertex;
+
+void main()
+{
+ gl_Position = vertex;
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(vertices = 3) out;
+
+out block {
+ dvec4 tcs_var0[4];
+} blk[];
+
+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);
+ blk[gl_InvocationID].tcs_var0[0] = dvec4(1.0LF, 0.0LF, 0.0LF, 1.0LF);
+ blk[gl_InvocationID].tcs_var0[1] = dvec4(0.0LF, 1.0LF, 0.0LF, 1.0LF);
+ blk[gl_InvocationID].tcs_var0[2] = dvec4(0.0LF, 0.0LF, 1.0LF, 1.0LF);
+ blk[gl_InvocationID].tcs_var0[3] = dvec4(1.0LF, 1.0LF, 0.0LF, 1.0LF);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(triangles) in;
+
+uniform int index;
+in block {
+ dvec4 tcs_var0[4];
+} blk[];
+
+out vec4 color;
+
+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];
+
+ color = vec4(blk[0].tcs_var0[index]);
+}
+
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64: require
+in vec4 color;
+
+void main()
+{
+ gl_FragColor = color;
+}
+
+[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
+
+uniform int index 0
+draw arrays GL_PATCHES 0 6
+probe all rgba 1.0 0.0 0.0 1.0
+
+uniform int index 1
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform int index 2
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 0.0 1.0 1.0
+
+uniform int index 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 1.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_tessellation_shader/execution/variable-indexing/vs-output-array-dvec4-index-wr-before-tcs.shader_test b/tests/spec/arb_tessellation_shader/execution/variable-indexing/vs-output-array-dvec4-index-wr-before-tcs.shader_test
new file mode 100644
index 0000000..bfd91b6
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/variable-indexing/vs-output-array-dvec4-index-wr-before-tcs.shader_test
@@ -0,0 +1,103 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+GL_ARB_gpu_shader_fp64
+
+[vertex shader]
+#extension GL_ARB_gpu_shader_fp64: require
+
+uniform int index;
+
+in vec4 vertex;
+
+out block {
+ dvec4 vs_var0[4];
+} blk;
+
+void main()
+{
+ gl_Position = vertex;
+ blk.vs_var0[0] = dvec4(0.0LF);
+ blk.vs_var0[1] = dvec4(0.25LF);
+ blk.vs_var0[2] = dvec4(0.50LF);
+ blk.vs_var0[3] = dvec4(0.75LF);
+ blk.vs_var0[index] = dvec4(0.0LF, 1.0LF, 0.0LF, 1.0LF);
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(vertices = 3) out;
+
+uniform int index;
+in block {
+ dvec4 vs_var0[4];
+} blk[];
+
+out vec4 color[];
+
+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);
+
+ color[gl_InvocationID] = vec4(blk[gl_InvocationID].vs_var0[index]);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_gpu_shader_fp64: require
+layout(triangles) in;
+
+in vec4 color[];
+out vec4 fs_color;
+
+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];
+
+ fs_color = vec4(color[0]);
+}
+
+
+[fragment shader]
+#extension GL_ARB_gpu_shader_fp64: require
+in vec4 fs_color;
+
+void main()
+{
+ gl_FragColor = fs_color;
+}
+
+[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
+
+uniform int index 0
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform int index 1
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform int index 2
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
+
+uniform int index 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
--
2.7.4
More information about the Piglit
mailing list