yum-mirror/glslang

git clone https://git.yummers.dev/yum-mirror/glslang

Zackery Mason-BlaugFix several issues with link-time implicit array size mergingfd433938

main
1.5 KiB55 linesraw
1#version 460
2
3#extension GL_EXT_nonuniform_qualifier : require
4
5// unsized and not indexed in either stage
6// both should become implicitly sized to 1
7uniform float f0[];
8
9// unsized and not indexed in earlier stage, unsized and dynamically indexed in later stage
10// both should become runtime sized
11uniform sampler2D s0[];
12
13// unsized and dynamically indexed in earlier stage, unsized and not indexed in later stage
14// both should become runtime sized
15uniform sampler2D s1[];
16
17// unsized and statically indexed in earlier stage, unsized and not indexed in later stage
18// both should become implicitly sized to highest index + 1 (11)
19uniform U0 {
20    vec4 a[];
21} u0;
22
23// unsized and not indexed in earlier stage, unsized and statically indexed in later stage
24// both should become implicitly sized to highest index + 1 (7)
25uniform U1 {
26    vec4 a[];
27} u1;
28
29// unsized buffer array, statically indexed in earlier stage, not indexed in later stage
30// both should become implicitly sized to highest index + 1 (10)
31buffer B0 {
32    vec4 a;
33} b0[];
34
35// unsized and statically indexed in earlier stage, explicitly sized in later stage
36// should adopt explicit size (11)
37buffer B1 {
38    vec4 a[11];
39} b1;
40
41// unsized and not indexed in earlier stage, unsized and dynamically indexed in later stage
42// both should become runtime sized
43buffer B2 {
44    vec4 a[];
45} b2;
46
47in vec4 out_VS;
48out vec4 o;
49
50void main() {
51    o = texture(s0[nonuniformEXT(1)], gl_FragCoord.xy);
52    o += u1.a[6];
53    o += b0[9].a;
54    o += b2.a[nonuniformEXT(1)];
55}