]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/specialized_array_in_struct.glsl
Don't ignore structs entirely in UnusedVariableRemover
[libs/gl.git] / tests / glsl / specialized_array_in_struct.glsl
1 layout(constant_id=auto) const int max_colors = 2;
2 struct ColorInfo
3 {
4         vec4 color;
5 };
6 uniform Colors
7 {
8         ColorInfo colors[max_colors];
9 };
10
11 #pragma MSP stage(vertex)
12 layout(location=0) in vec4 position;
13 void main()
14 {
15         gl_Position = position;
16 }
17
18 #pragma MSP stage(fragment)
19 layout(location=0) out vec4 frag_color;
20 void main()
21 {
22         frag_color = colors[0].color;
23 }
24
25 // Compile mode: module
26
27 /* Expected output: vertex
28 layout(location=0) in vec4 position;
29 void main()
30 {
31         gl_Position = position;
32 }
33 */
34
35 /* Expected output: fragment
36 layout(constant_id=953017667) const int max_colors = 2;
37 struct ColorInfo
38 {
39         vec4 color;
40 };
41 layout(binding=23) uniform Colors
42 {
43         ColorInfo colors[max_colors];
44 };
45 layout(location=0) out vec4 frag_color;
46 void main()
47 {
48         frag_color = colors[0].color;
49 }
50 */