[Piglit] [PATCH 1/2] arb_shader_subroutine: Compile a shader that calls a subroutine with a parameter

Ian Romanick idr at freedesktop.org
Thu Jan 14 16:23:58 PST 2016


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

NOTE: This test segfaults on Mesa.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93722
Cc: Dave Airlie <airlied at redhat.com>
Cc: Nicolas Koch <nioko1337 at googlemail.com>
---
 .../compiler/call-param-match.vert                 | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 tests/spec/arb_shader_subroutine/compiler/call-param-match.vert

diff --git a/tests/spec/arb_shader_subroutine/compiler/call-param-match.vert b/tests/spec/arb_shader_subroutine/compiler/call-param-match.vert
new file mode 100644
index 0000000..fca0f83
--- /dev/null
+++ b/tests/spec/arb_shader_subroutine/compiler/call-param-match.vert
@@ -0,0 +1,29 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_shader_subroutine
+// [end config]
+
+#version 150
+#extension GL_ARB_shader_subroutine: require
+
+uniform vec4 u;
+out vec4 piglit_fragcolor;
+subroutine vec4 func_type(vec4 color);
+
+subroutine uniform func_type f;
+
+subroutine(func_type) float R(vec4 p)
+{
+    return p.r;
+}
+
+subroutine(func_type) float G(vec4 p)
+{
+    return p.g;
+}
+
+void main()
+{
+    piglit_fragcolor = f(u);
+}
-- 
2.5.0



More information about the Piglit mailing list