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 KiB53 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[];
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
47out vec4 out_VS;
48
49void main() {
50    out_VS = texture(s1[nonuniformEXT(0)], vec2(0));
51    out_VS = u0.a[10];
52    out_VS = b1.a[5];
53}