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