summaryrefslogtreecommitdiff
path: root/tests/spec
diff options
context:
space:
mode:
authorChris Forbes <chrisf@ijw.co.nz>2014-04-12 12:32:57 +1200
committerChris Forbes <chrisf@ijw.co.nz>2014-04-12 15:52:22 +1200
commitabccdce29c5ca53cf1b15b4eec24ae5e1b254ebc (patch)
tree56acd9d85e01f66a807745d729ff4eea8c5a38fe /tests/spec
parente67765a97bec944ad1bb553644a60ad87f02ff10 (diff)
arb_gpu_shader5: Test some more `sample` qualifier cases.
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@ijw.co.nz> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'tests/spec')
-rw-r--r--tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-centroid-disallowed.frag25
-rw-r--r--tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-interface-block.frag19
-rw-r--r--tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-struct-disallowed.frag20
-rw-r--r--tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-in-uniform-block-disallowed.frag20
-rw-r--r--tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-temp-disallowed.frag20
-rw-r--r--tests/spec/arb_gpu_shader5/compiler/sample-qualifier/fs-sample-uniform-disallowed.frag17
6 files changed, 121 insertions, 0 deletions
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 000000000..b1439a68b
--- /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 000000000..8c1d2dec0
--- /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 000000000..0409664dc
--- /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 000000000..b4d909739
--- /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 000000000..405820c30
--- /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 000000000..f168aab53
--- /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;
+}
+