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 // Compile mode: module
29 /* Expected output: vertex
30 layout(location=0) uniform mat4 mvp;
31 layout(location=0) in vec4 position;
32 layout(location=1) in vec4 color;
33 layout(location=2) in vec2 texcoord;
34 layout(location=0) out vec4 _vs_out_color;
35 layout(location=1) out vec2 _vs_out_texcoord;
38 _vs_out_color = color;
39 _vs_out_texcoord = texcoord;
40 gl_Position = mvp*position;
44 /* Expected output: fragment
45 layout(constant_id=0) const bool use_texture = false;
46 layout(constant_id=1) const bool use_vertex_color = false;
47 layout(location=4, binding=71) uniform sampler2D tex;
48 layout(location=0) out vec4 frag_color;
49 layout(location=1) in vec2 _vs_out_texcoord;
50 layout(location=0) in vec4 _vs_out_color;
53 frag_color = vec4(1.0);
55 frag_color *= texture(tex, _vs_out_texcoord);
57 frag_color *= _vs_out_color;