]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/geometry_passthrough.glsl
Check the flat qualifier from the correct member
[libs/gl.git] / tests / glsl / geometry_passthrough.glsl
1 uniform sampler2D tex;
2
3 #pragma MSP stage(vertex)
4 layout(location=0) in vec4 position;
5 void main()
6 {
7         out vec2 texcoord = position.xy*0.5+0.5;
8         gl_Position = position;
9 }
10
11 #pragma MSP stage(geometry)
12 layout(triangles) in;
13 layout(triangle_strip, max_vertices=3) out;
14 void main()
15 {
16         for(int i=0; i<3; ++i)
17         {
18                 passthrough[i];
19                 EmitVertex();
20         }
21 }
22
23 #pragma MSP stage(fragment)
24 layout(location=0) out vec4 frag_color;
25 void main()
26 {
27         frag_color = texture(tex, texcoord);
28 }
29
30 // Target API: Vulkan
31
32 /* Expected output: vertex
33 layout(location=0) in vec4 position;
34 layout(location=0) out vec2 texcoord;
35 void main()
36 {
37         texcoord = position.xy*0.5+0.5;
38         gl_Position = position;
39 }
40 */
41
42 /* Expected output: geometry
43 layout(triangles) in;
44 layout(triangle_strip, max_vertices=3) out;
45 layout(location=0) in vec2 texcoord[3];
46 layout(location=0) out vec2 _gs_out_texcoord;
47 void main()
48 {
49         for(int i = 0; i<3; ++i)
50         {
51                 gl_Position = gl_in[i].gl_Position;
52                 _gs_out_texcoord = texcoord[i];
53                 EmitVertex();
54         }
55 }
56 */
57
58 /* Expected output: fragment
59 layout(set=0, binding=71) uniform sampler2D tex;
60 layout(location=0) out vec4 frag_color;
61 layout(location=0) in vec2 _gs_out_texcoord;
62 void main()
63 {
64         frag_color = texture(tex, _gs_out_texcoord);
65 }
66 */