]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/referenced_but_unassigned_output.glsl
aabff0892a2d4aa54b8286a026f8c969497fd18a
[libs/gl.git] / tests / glsl / referenced_but_unassigned_output.glsl
1 uniform mat4 projection;
2
3 #pragma MSP stage(vertex)
4 layout(location=0) in vec4 position;
5 layout(location=1) in vec3 normal;
6 out vec4 eye_vertex;
7 out VertexOut
8 {
9         vec4 color;
10 };
11 void main()
12 {
13         gl_Position = projection*eye_vertex;
14         out float alpha = color.a;
15 }
16
17 #pragma MSP stage(fragment)
18 layout(location=0) out vec4 frag_color;
19 void main()
20 {
21         frag_color = vec4(color.rgb, alpha);
22 }
23
24 /* Expected output: vertex
25 uniform mat4 projection;
26 out vec4 eye_vertex;
27 out VertexOut
28 {
29   vec4 color;
30 };
31 out float alpha;
32 void main()
33 {
34   gl_Position = projection*eye_vertex;
35   alpha = color.a;
36 }
37 */
38
39 /* Expected output: fragment
40 layout(location=0) out vec4 frag_color;
41 in VertexOut
42 {
43   vec4 color;
44 };
45 in float alpha;
46 void main()
47 {
48   frag_color = vec4(color.rgb, alpha);
49 }
50 */