1 # test calling subroutine uniforms with
2 # a non constant array index works.
5 GL_ARB_shader_subroutine
7 [vertex shader passthrough]
11 #extension GL_ARB_shader_subroutine: enable
15 subroutine float getchan1();
17 subroutine uniform getchan1 GetChan1[2];
35 color = vec4(GetChan1[pick](), GetChan1[1 - pick](), 0.0, 1.0);
40 clear color 0.0 0.0 1.0 0.0
43 subuniform GL_FRAGMENT_SHADER GetChan1[0] chan_full
44 subuniform GL_FRAGMENT_SHADER GetChan1[1] chan_empty
46 probe all rgba 1.0 0.0 0.0 1.0
48 subuniform GL_FRAGMENT_SHADER GetChan1[0] chan_empty
49 subuniform GL_FRAGMENT_SHADER GetChan1[1] chan_full
51 probe all rgba 1.0 0.0 0.0 1.0