[Piglit] [PATCH] arb_gpu_shader5: Test some more `sample` qualifier cases.
Chris Forbes
chrisf at ijw.co.nz
Fri Apr 11 17:32:57 PDT 2014
Mesa has been allowing `sample` (and `centroid`) in a bunch of places
where they are not valid. These tests exercise a few more interesting
cases.
Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
.../fs-sample-centroid-disallowed.frag | 25 ++++++++++++++++++++++
.../fs-sample-in-interface-block.frag | 19 ++++++++++++++++
.../fs-sample-in-struct-disallowed.frag | 20 +++++++++++++++++
.../fs-sample-in-uniform-block-disallowed.frag | 20 +++++++++++++++++
.../fs-sample-temp-disallowed.frag | 20 +++++++++++++++++
.../fs-sample-uniform-disallowed.frag | 17 +++++++++++++++
6 files changed, 121 insertions(+)
create mode 100644 tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-centroid-disallowed.frag
create mode 100644 tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-interface-block.frag
create mode 100644 tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-struct-disallowed.frag
create mode 100644 tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-uniform-block-disallowed.frag
create mode 100644 tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-temp-disallowed.frag
create mode 100644 tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-uniform-disallowed.frag
diff --git a/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-centroid-disallowed.frag b/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-centroid-disallowed.frag
new file mode 100644
index 0000000..b1439a6
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-centroid-disallowed.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader5
+// [end config]
+
+#version 150
+#extension GL_ARB_gpu_shader5: 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/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-interface-block.frag b/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-interface-block.frag
new file mode 100644
index 0000000..8c1d2de
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-interface-block.frag
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader5
+// [end config]
+
+#version 150
+#extension GL_ARB_gpu_shader5: require
+
+in fragment_inputs {
+ sample vec4 x;
+};
+out vec4 out_color;
+
+void main()
+{
+ out_color = x;
+}
+
diff --git a/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-struct-disallowed.frag b/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-struct-disallowed.frag
new file mode 100644
index 0000000..0409664
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-struct-disallowed.frag
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader5
+// [end config]
+
+#version 150
+#extension GL_ARB_gpu_shader5: 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/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-uniform-block-disallowed.frag b/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-uniform-block-disallowed.frag
new file mode 100644
index 0000000..b4d9097
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-uniform-block-disallowed.frag
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader5
+// [end config]
+
+#version 150
+#extension GL_ARB_gpu_shader5: 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/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-temp-disallowed.frag b/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-temp-disallowed.frag
new file mode 100644
index 0000000..405820c
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-temp-disallowed.frag
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader5
+// [end config]
+
+#version 150
+#extension GL_ARB_gpu_shader5: 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/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-uniform-disallowed.frag b/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-uniform-disallowed.frag
new file mode 100644
index 0000000..f168aab
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-uniform-disallowed.frag
@@ -0,0 +1,17 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader5
+// [end config]
+
+#version 150
+#extension GL_ARB_gpu_shader5: require
+
+sample uniform vec4 x;
+out vec4 out_color;
+
+void main()
+{
+ out_color = x;
+}
+
--
1.9.2
More information about the Piglit
mailing list