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