[Piglit] [PATCH 1/3 v2] arb_shader_subroutine: Compile a shader that calls a subroutine with a parameter
Ian Romanick
idr at freedesktop.org
Thu Jan 14 16:57:19 PST 2016
From: Ian Romanick <ian.d.romanick at intel.com>
NOTE: This test segfaults on Mesa.
v2: Fix bad assignment to piglit_fragcolor that would have cause the
shader to not compile... if it didn't already segfault. Noticed by
Ilia. Also fix the type of func_type to match the functions and make
the test .frag (as originally intended).
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93722
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu> [v1]
Cc: Dave Airlie <airlied at redhat.com>
Cc: Nicolas Koch <nioko1337 at googlemail.com>
---
.../compiler/call-param-match.frag | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 tests/spec/arb_shader_subroutine/compiler/call-param-match.frag
diff --git a/tests/spec/arb_shader_subroutine/compiler/call-param-match.frag b/tests/spec/arb_shader_subroutine/compiler/call-param-match.frag
new file mode 100644
index 0000000..a698d61
--- /dev/null
+++ b/tests/spec/arb_shader_subroutine/compiler/call-param-match.frag
@@ -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 float 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 = vec4(f(u));
+}
--
2.5.0
More information about the Piglit
mailing list