[Piglit] [PATCH] arb_fragment_shader_interlock: Simple compiler tests

Ian Romanick idr at freedesktop.org
Tue Aug 28 20:03:52 UTC 2018


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

Currently none of the negative tests produce the expected result on
Mesa.  There are other cases called out by the spec as things you cannot
do, but it's not clear what the expected result is in those cases
(compile- or link-time error, undefined rendering, GPU hang, house fire,
etc.).

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 ...InvocationInterlock-endInvocationInterlock.frag | 15 ++++++++++++++
 .../compiler/beginInvocationInterlock-twice.frag   | 23 ++++++++++++++++++++++
 ...nInterlock-before-beginInvocationInterlock.frag | 22 +++++++++++++++++++++
 .../compiler/endInvocationInterlock-twice.frag     | 23 ++++++++++++++++++++++
 4 files changed, 83 insertions(+)
 create mode 100644 tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-endInvocationInterlock.frag
 create mode 100644 tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-twice.frag
 create mode 100644 tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-before-beginInvocationInterlock.frag
 create mode 100644 tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-twice.frag

diff --git a/tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-endInvocationInterlock.frag b/tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-endInvocationInterlock.frag
new file mode 100644
index 000000000..c2e948e25
--- /dev/null
+++ b/tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-endInvocationInterlock.frag
@@ -0,0 +1,15 @@
+// [config]
+// expect_result: pass
+// glsl_version: 4.20
+// require_extensions: GL_ARB_fragment_shader_interlock
+// check_link: true
+// [end config]
+
+#version 420
+#extension GL_ARB_fragment_shader_interlock: require
+
+void main()
+{
+	beginInvocationInterlockARB();
+	endInvocationInterlockARB();
+}
diff --git a/tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-twice.frag b/tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-twice.frag
new file mode 100644
index 000000000..52364ea12
--- /dev/null
+++ b/tests/spec/arb_fragment_shader_interlock/compiler/beginInvocationInterlock-twice.frag
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: fail
+// glsl_version: 4.20
+// require_extensions: GL_ARB_fragment_shader_interlock
+// check_link: true
+// [end config]
+
+/* The GL_ARB_fragment_shader_interlock spec says:
+ *
+ *    A compile- or link-time error will be generated if main() calls either
+ *    function more than once, contains a call to one function without a
+ *    matching call to the other, or calls endInvocationInterlockARB() before
+ *    calling beginInvocationInterlockARB().
+ */
+#version 420
+#extension GL_ARB_fragment_shader_interlock: require
+
+void main()
+{
+	beginInvocationInterlockARB();
+	beginInvocationInterlockARB();
+	endInvocationInterlockARB();
+}
diff --git a/tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-before-beginInvocationInterlock.frag b/tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-before-beginInvocationInterlock.frag
new file mode 100644
index 000000000..9860050d0
--- /dev/null
+++ b/tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-before-beginInvocationInterlock.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 4.20
+// require_extensions: GL_ARB_fragment_shader_interlock
+// check_link: true
+// [end config]
+
+/* The GL_ARB_fragment_shader_interlock spec says:
+ *
+ *    A compile- or link-time error will be generated if main() calls either
+ *    function more than once, contains a call to one function without a
+ *    matching call to the other, or calls endInvocationInterlockARB() before
+ *    calling beginInvocationInterlockARB().
+ */
+#version 420
+#extension GL_ARB_fragment_shader_interlock: require
+
+void main()
+{
+	endInvocationInterlockARB();
+	beginInvocationInterlockARB();
+}
diff --git a/tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-twice.frag b/tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-twice.frag
new file mode 100644
index 000000000..4ac44f38c
--- /dev/null
+++ b/tests/spec/arb_fragment_shader_interlock/compiler/endInvocationInterlock-twice.frag
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: fail
+// glsl_version: 4.20
+// require_extensions: GL_ARB_fragment_shader_interlock
+// check_link: true
+// [end config]
+
+/* The GL_ARB_fragment_shader_interlock spec says:
+ *
+ *    A compile- or link-time error will be generated if main() calls either
+ *    function more than once, contains a call to one function without a
+ *    matching call to the other, or calls endInvocationInterlockARB() before
+ *    calling beginInvocationInterlockARB().
+ */
+#version 420
+#extension GL_ARB_fragment_shader_interlock: require
+
+void main()
+{
+	beginInvocationInterlockARB();
+	endInvocationInterlockARB();
+	endInvocationInterlockARB();
+}
-- 
2.14.4



More information about the Piglit mailing list