From 6187713c10c6937587fda500d35872629b578ec4 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 1 Oct 2015 10:57:11 +1000 Subject: arb_shader_subroutine: add a vertex shader test This tests vertex shaders work with shader subroutine. Reviewed-by: Timothy Arceri Signed-off-by: Dave Airlie --- .../execution/vs-simple-subroutine.shader-test | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tests/spec/arb_shader_subroutine/execution/vs-simple-subroutine.shader-test (limited to 'tests') 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 -- cgit v1.2.3