3 #pragma MSP stage(vertex)
4 layout(location=0) in vec4 position;
7 out vec2 texcoord = position.xy*0.5+0.5;
8 gl_Position = position;
11 #pragma MSP stage(geometry)
13 layout(triangle_strip, max_vertices=3) out;
16 for(int i=0; i<3; ++i)
23 #pragma MSP stage(fragment)
24 layout(location=0) out vec4 frag_color;
27 frag_color = texture(tex, texcoord);
30 /* Expected output: vertex
31 layout(location=0) in vec4 position;
35 texcoord = position.xy*0.5+0.5;
36 gl_Position = position;
40 /* Expected output: geometry
42 layout(triangle_strip, max_vertices=3) out;
44 out vec2 _gs_out_texcoord;
47 for(int i = 0; i<3; ++i)
49 gl_Position = gl_in[i].gl_Position;
50 _gs_out_texcoord = texcoord[i];
56 /* Expected output: fragment
57 uniform sampler2D tex;
58 layout(location=0) out vec4 frag_color;
59 in vec2 _gs_out_texcoord;
62 frag_color = texture(tex, _gs_out_texcoord);