1 layout(constant_id=0) const bool use_texture = false;
2 layout(constant_id=1) const bool use_vertex_color = false;
4 layout(push_constant) uniform Transform
9 #pragma MSP stage(vertex)
10 layout(location=0) in vec4 position;
11 layout(location=1) in vec4 color;
12 layout(location=2) in vec2 texcoord;
16 gl_Position = mvp*position;
19 #pragma MSP stage(fragment)
20 layout(location=0) out vec4 frag_color;
23 frag_color = vec4(1.0);
25 frag_color *= texture(tex, texcoord);
31 // Specialize: use_texture true
33 /* Expected output: vertex
34 layout(push_constant) uniform Transform
38 layout(location=0) in vec4 position;
39 layout(location=2) in vec2 texcoord;
40 layout(location=0) out vec2 _vs_out_texcoord;
43 _vs_out_texcoord = texcoord;
44 gl_Position = mvp*position;
48 /* Expected output: fragment
49 layout(set=0, binding=71) uniform sampler2D tex;
50 layout(location=0) out vec4 frag_color;
51 layout(location=0) in vec2 _vs_out_texcoord;
54 frag_color = vec4(1.0);
55 frag_color *= texture(tex, _vs_out_texcoord);