summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2016-01-14 16:00:23 -0800
committerIan Romanick <ian.d.romanick@intel.com>2016-01-20 16:36:30 -0800
commitd87159e42658b1ca4046183ce5505078a26ee9ed (patch)
tree5be4cc7f8146994a5b03c0896331c7b76dcbb8c7
parent3af6e2c6127c723d93e54574d38a967eaf105812 (diff)
arb_shader_subroutine: Compile a shader that calls a subroutine with a parameter
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@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93722 Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> [v1] Cc: Dave Airlie <airlied@redhat.com> Cc: Nicolas Koch <nioko1337@googlemail.com>
-rw-r--r--tests/spec/arb_shader_subroutine/compiler/call-param-match.frag29
1 files changed, 29 insertions, 0 deletions
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 000000000..a698d615e
--- /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));
+}