1 # two subroutines using the same functions
2 # as backends for the types.
5 GL_ARB_shader_subroutine
7 [vertex shader passthrough]
11 #extension GL_ARB_shader_subroutine: enable
15 subroutine float getchan1();
16 subroutine uniform getchan1 GetChan1;
18 subroutine float getchan2();
19 subroutine uniform getchan2 GetChan2;
21 subroutine(getchan1, getchan2)
27 subroutine(getchan1, getchan2)
35 color = vec4(GetChan1(), GetChan2(), 0.0, 1.0);
40 clear color 0.0 0.0 1.0 0.0
42 subuniform GL_FRAGMENT_SHADER GetChan1 chan_full
43 subuniform GL_FRAGMENT_SHADER GetChan2 chan_empty
45 probe all rgba 1.0 0.0 0.0 1.0
46 subuniform GL_FRAGMENT_SHADER GetChan1 chan_empty
47 subuniform GL_FRAGMENT_SHADER GetChan2 chan_full
49 probe all rgba 0.0 1.0 0.0 1.0