1 # simple display list test using one shader subroutine.
6 GL_ARB_shader_subroutine
8 [vertex shader passthrough]
12 #extension GL_ARB_shader_subroutine: enable
16 subroutine vec4 getcolor();
17 subroutine uniform getcolor GetColor;
22 return vec4(1.0, 0.0, 0.0, 1.0);
28 return vec4(0.0, 1.0, 0.0, 1.0);
34 return vec4(0.0, 0.0, 1.0, 1.0);
44 clear color 0.1 0.1 0.1 0.1
47 # Initialise subroutine to make sure call list is respected
48 subuniform GL_FRAGMENT_SHADER GetColor color_blue
50 probe all rgba 0.0 0.0 1.0 1.0
52 clear color 0.1 0.1 0.1 0.1
56 subuniform GL_FRAGMENT_SHADER GetColor color_red
60 # make sure we haven't drawn anything yet
61 probe all rgba 0.1 0.1 0.1 0.1
63 # Set wrong subroutine to make sure the call list is respected
64 subuniform GL_FRAGMENT_SHADER GetColor color_blue
66 probe all rgba 0.0 0.0 1.0 1.0
69 probe all rgba 1.0 0.0 0.0 1.0
73 clear color 0.1 0.1 0.1 0.1
76 newlist GL_COMPILE_AND_EXECUTE
77 subuniform GL_FRAGMENT_SHADER GetColor color_green
81 probe all rgba 0.0 1.0 0.0 1.0
83 # Set wrong subroutine to make sure the call list is respected
84 subuniform GL_FRAGMENT_SHADER GetColor color_blue
86 probe all rgba 0.0 0.0 1.0 1.0
88 clear color 0.1 0.1 0.1 0.1
92 probe all rgba 0.0 1.0 0.0 1.0