2 uniform int mask_index;
4 #pragma MSP stage(vertex)
5 layout(location=0) in vec4 position;
6 layout(location=1) in vec4 color;
14 int index = mask_index%4;
16 vs_out.color[index] = 0.0;
17 vs_out.mask_color = vec4(1.0);
18 vs_out.mask_color[index] = 1.0;
19 gl_Position = mvp*position;
22 #pragma MSP stage(fragment)
23 layout(location=0) out vec4 frag_color;
26 frag_color = vs_out.color+vs_out.mask_color;
29 /* Expected output: vertex
30 layout(location=0) uniform mat4 mvp;
31 layout(location=4) uniform int mask_index;
32 layout(location=0) in vec4 position;
33 layout(location=1) in vec4 color;
41 int index = mask_index%4;
43 vs_out.color[index] = 0.0;
44 vs_out.mask_color = vec4(1.0);
45 vs_out.mask_color[index] = 1.0;
46 gl_Position = mvp*position;
50 /* Expected output: fragment
51 layout(location=0) out vec4 frag_color;
59 frag_color = vs_out.color+vs_out.mask_color;