]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/geometry_interface_block.glsl
Fix a bug in makefont.py if no ranges are given
[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 /* Expected output: vertex
40 layout(location=0) in vec4 position;
41 out VertexOut
42 {
43         vec2 texcoord;
44 } vs_out;
45 void main()
46 {
47         vs_out.texcoord = position.xy*0.5+0.5;
48         gl_Position = position;
49 }
50 */
51
52 /* Expected output: geometry
53 layout(triangles) in;
54 layout(triangle_strip, max_vertices=3) out;
55 out GeometryOut
56 {
57         vec2 texcoord;
58 } gs_out;
59 in VertexOut
60 {
61         vec2 texcoord;
62 } vs_out[];
63 void main()
64 {
65         for(int i = 0; i<3; ++i)
66         {
67                 gs_out.texcoord = vs_out[i].texcoord;
68                 gl_Position = gl_in[i].gl_Position;
69                 EmitVertex();
70         }
71 }
72 */
73
74 /* Expected output: fragment
75 layout(location=0, binding=71) uniform sampler2D tex;
76 layout(location=0) out vec4 frag_color;
77 in GeometryOut
78 {
79         vec2 texcoord;
80 } gs_out;
81 void main()
82 {
83         frag_color = texture(tex, gs_out.texcoord);
84 }
85 */