Signed-off-by: Chris Forbes <[email protected]>
---
 .../linker/no-mutual-recursion.vert                | 29 ++++++++++++++++++++++
 .../linker/no-simple-recursion.vert                | 23 +++++++++++++++++
 2 files changed, 52 insertions(+)
 create mode 100644 
tests/spec/arb_shader_subroutine/linker/no-mutual-recursion.vert
 create mode 100644 
tests/spec/arb_shader_subroutine/linker/no-simple-recursion.vert

diff --git a/tests/spec/arb_shader_subroutine/linker/no-mutual-recursion.vert 
b/tests/spec/arb_shader_subroutine/linker/no-mutual-recursion.vert
new file mode 100644
index 0000000..726a641
--- /dev/null
+++ b/tests/spec/arb_shader_subroutine/linker/no-mutual-recursion.vert
@@ -0,0 +1,29 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_shader_subroutine
+// check_link: true
+// [end config]
+
+#version 150
+#extension GL_ARB_shader_subroutine: require
+
+/* Two mutually-recursive subroutines */
+
+subroutine void func_type_a(int x);
+subroutine void func_type_b(int x);
+
+subroutine uniform func_type_a func_a;
+subroutine uniform func_type_b func_b;
+
+subroutine (func_type) void impl_a(int x) {
+       if (x > 0) func_b(x - 1);
+}
+
+subroutine (func_type) void impl_b(int x) {
+       if (x > 0) func_a(x - 1);
+}
+
+void main() {
+       func_a(42);
+}
diff --git a/tests/spec/arb_shader_subroutine/linker/no-simple-recursion.vert 
b/tests/spec/arb_shader_subroutine/linker/no-simple-recursion.vert
new file mode 100644
index 0000000..5b4e41a
--- /dev/null
+++ b/tests/spec/arb_shader_subroutine/linker/no-simple-recursion.vert
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_shader_subroutine
+// check_link: true
+// [end config]
+
+#version 150
+#extension GL_ARB_shader_subroutine: require
+
+/* Simple recursion via a subroutine */
+
+subroutine void func_type(int x);
+
+subroutine uniform func_type func;
+
+subroutine (func_type) void impl(int x) {
+       if (x > 0) func(x - 1);
+}
+
+void main() {
+       func(42);
+}
-- 
2.0.4

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to