1 layout(constant_id=0) const bool use_texture = false;
2 layout(constant_id=1) const bool use_vertex_color = false;
6 #pragma MSP stage(vertex)
7 layout(location=0) in vec4 position;
8 layout(location=1) in vec4 color;
9 layout(location=2) in vec2 texcoord;
13 gl_Position = mvp*position;
16 #pragma MSP stage(fragment)
17 layout(location=0) out vec4 frag_color;
20 frag_color = vec4(1.0);
22 frag_color *= texture(tex, texcoord);
27 // Specialize: use_texture true
29 /* Expected output: vertex
31 layout(location=0) in vec4 position;
32 layout(location=2) in vec2 texcoord;
33 out vec2 _vs_out_texcoord;
36 _vs_out_texcoord = texcoord;
37 gl_Position = mvp*position;
41 /* Expected output: fragment
42 uniform sampler2D tex;
43 layout(location=0) out vec4 frag_color;
44 in vec2 _vs_out_texcoord;
47 frag_color = vec4(1.0);
48 frag_color *= texture(tex, _vs_out_texcoord);