[Piglit] [PATCH 06/11] mesa_shader_integer_functions: Clone arb_gpu_shader5 sample qualifier tests

Ian Romanick idr at freedesktop.org
Wed Jun 29 21:23:06 UTC 2016


From: Ian Romanick <ian.d.romanick at intel.com>

GL_MESA_shader_integer_functions does not add the sample qualifier, so
all of these tests should fail.

    cd tests/spec/mesa_shader_integer_functions/compiler
    cp -a ../../arb_gpu_shader5/compiler/sample-qualifier .
    cd sample-qualifier
    rm *.geom
    for i in *; do
        sed --in-place -e 's/1[.]50/1.30/g;s/150/130/g' \
            -e 's/ARB_gpu_shader5/MESA_shader_integer_functions/g' \
            -e 's/expect_result: pass/expect_result: fail/' \
            $i
    done

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 .../fs-sample-centroid-disallowed.frag             | 25 ++++++++++++++++++++++
 .../fs-sample-in-interface-block.frag              | 19 ++++++++++++++++
 .../sample-qualifier/fs-sample-in-no-writes.frag   | 22 +++++++++++++++++++
 .../sample-qualifier/fs-sample-in-qualifier.frag   | 17 +++++++++++++++
 .../fs-sample-in-struct-disallowed.frag            | 20 +++++++++++++++++
 .../fs-sample-in-uniform-block-disallowed.frag     | 20 +++++++++++++++++
 .../sample-qualifier/fs-sample-out-qualifier.frag  | 20 +++++++++++++++++
 .../fs-sample-temp-disallowed.frag                 | 20 +++++++++++++++++
 .../fs-sample-uniform-disallowed.frag              | 17 +++++++++++++++
 .../sample-qualifier/vs-sample-in-qualifier.vert   | 16 ++++++++++++++
 .../sample-qualifier/vs-sample-out-qualifier.vert  | 17 +++++++++++++++
 11 files changed, 213 insertions(+)
 create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-centroid-disallowed.frag
 create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-interface-block.frag
 create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-no-writes.frag
 create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-qualifier.frag
 create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-struct-disallowed.frag
 create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-uniform-block-disallowed.frag
 create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-out-qualifier.frag
 create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-temp-disallowed.frag
 create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-uniform-disallowed.frag
 create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/vs-sample-in-qualifier.vert
 create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/vs-sample-out-qualifier.vert

diff --git a/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-centroid-disallowed.frag b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-centroid-disallowed.frag
new file mode 100644
index 0000000..114f6a2
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-centroid-disallowed.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+/* At most one aux. storage qualifier is allowed.
+ * Note that strictly speaking, under gpu_shader5 / GLSL 4.00,
+ * the storage qualifier is the entire 'centroid in' or 'sample in',
+ * but we use the wording from shading_language_420pack / GLSL 4.20.
+ *
+ * A strict gpu_shader5 / GLSL 4.00 implementation should reject this
+ * too.
+ */
+sample centroid in vec4 x;
+out vec4 out_color;
+
+void main()
+{
+	out_color = x;
+}
+
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-interface-block.frag b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-interface-block.frag
new file mode 100644
index 0000000..d77b114
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-interface-block.frag
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+in fragment_inputs {
+	sample vec4 x;
+};
+out vec4 out_color;
+
+void main()
+{
+	out_color = x;
+}
+
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-no-writes.frag b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-no-writes.frag
new file mode 100644
index 0000000..49ef9f2
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-no-writes.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// From the MESA_shader_integer_functions spec:
+// "Variables declared as ..., or sample in may
+// not be written to during shader execution."
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+sample in vec4 x;
+out vec4 out_color;
+
+void main()
+{
+	x = vec4(0);	/* not allowed */
+	out_color = vec4(1);
+}
+
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-qualifier.frag b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-qualifier.frag
new file mode 100644
index 0000000..2a7e742
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-qualifier.frag
@@ -0,0 +1,17 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+sample in vec4 x;
+out vec4 out_color;
+
+void main()
+{
+	out_color = x;
+}
+
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-struct-disallowed.frag b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-struct-disallowed.frag
new file mode 100644
index 0000000..073a43f
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-struct-disallowed.frag
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+struct things {
+	/* not allowed in struct declarations */
+	sample vec4 x;
+};
+out vec4 out_color;
+
+void main()
+{
+	out_color = vec4(1);
+}
+
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-uniform-block-disallowed.frag b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-uniform-block-disallowed.frag
new file mode 100644
index 0000000..e35bb10
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-in-uniform-block-disallowed.frag
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform things {
+	/* not allowed in uniform block */
+	sample vec4 x;
+};
+out vec4 out_color;
+
+void main()
+{
+	out_color = vec4(1);
+}
+
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-out-qualifier.frag b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-out-qualifier.frag
new file mode 100644
index 0000000..a072484
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-out-qualifier.frag
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+// From the MESA_shader_integer_functions spec:
+// "It is an error to use centroid out or sample out in a fragment shader"
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+sample out vec4 x;			/* not allowed */
+out vec4 out_color;
+
+void main()
+{
+	out_color = x;
+}
+
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-temp-disallowed.frag b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-temp-disallowed.frag
new file mode 100644
index 0000000..7ce2b67
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-temp-disallowed.frag
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+out vec4 out_color;
+
+void main()
+{
+	/* x is neither an input nor output, so 'sample' is not
+	 * legal here.
+	 */
+	sample vec4 x = vec4(1);
+	out_color = x;
+}
+
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-uniform-disallowed.frag b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-uniform-disallowed.frag
new file mode 100644
index 0000000..5a42d1a
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/fs-sample-uniform-disallowed.frag
@@ -0,0 +1,17 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+sample uniform vec4 x;
+out vec4 out_color;
+
+void main()
+{
+	out_color = x;
+}
+
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/vs-sample-in-qualifier.vert b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/vs-sample-in-qualifier.vert
new file mode 100644
index 0000000..7335b7d
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/vs-sample-in-qualifier.vert
@@ -0,0 +1,16 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+in vec4 y;
+sample in vec4 x;	/* this is not allowed */
+
+void main()
+{
+	gl_Position = y;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/vs-sample-out-qualifier.vert b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/vs-sample-out-qualifier.vert
new file mode 100644
index 0000000..166a6fd
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/sample-qualifier/vs-sample-out-qualifier.vert
@@ -0,0 +1,17 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+in vec4 y;
+sample out vec4 x;
+
+void main()
+{
+	x = y;
+	gl_Position = y;
+}
-- 
2.5.5



More information about the Piglit mailing list