summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-10-01 10:57:11 +1000
committerDave Airlie <airlied@redhat.com>2015-10-01 16:05:08 +1000
commit6187713c10c6937587fda500d35872629b578ec4 (patch)
tree4272e48896f0bc61f1f38196a332fb0222a8d9af
parente50905630b9f002d6d9aa7ccac6066f22a9524d6 (diff)
arb_shader_subroutine: add a vertex shader test
This tests vertex shaders work with shader subroutine. Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--tests/spec/arb_shader_subroutine/execution/vs-simple-subroutine.shader-test52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/spec/arb_shader_subroutine/execution/vs-simple-subroutine.shader-test b/tests/spec/arb_shader_subroutine/execution/vs-simple-subroutine.shader-test
new file mode 100644
index 000000000..1dfe6d3a9
--- /dev/null
+++ b/tests/spec/arb_shader_subroutine/execution/vs-simple-subroutine.shader-test
@@ -0,0 +1,52 @@
+# simple test using one shader subroutine.
+[require]
+GLSL >= 1.50
+GL_ARB_shader_subroutine
+
+[vertex shader]
+#version 150
+#extension GL_ARB_shader_subroutine: enable
+
+in vec4 piglit_vertex;
+out vec4 fcolor;
+subroutine vec4 getcolor();
+subroutine uniform getcolor GetColor;
+
+subroutine(getcolor)
+vec4 color_red()
+{
+ return vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+subroutine(getcolor)
+vec4 color_green()
+{
+ return vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+void main()
+{
+ gl_Position = piglit_vertex;
+ fcolor = GetColor();
+}
+
+[fragment shader]
+#version 150
+
+in vec4 fcolor;
+out vec4 color;
+
+void main()
+{
+ color = fcolor;
+}
+
+[test]
+clear color 0.0 0.0 1.0 0.0
+clear
+subuniform GL_VERTEX_SHADER GetColor color_red
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.0 0.0 1.0
+subuniform GL_VERTEX_SHADER GetColor color_green
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0