]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/specialized_array_in_struct.glsl
Disallow specialization constants in certain contexts
[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 error:
28 <test>:8: Reference to specialization constant 'max_colors' in a fixed constant expression
29 <test>:8: Reference to specialization constant 'max_colors' in a fixed constant expression
30 */