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.4 KiB44 linesraw
1#version 460
2
3// explicitly sized in earlier stage, unsized and statically indexed with larger index in later stage
4// error: array is indexed with index (6) greater than its size (3)
5uniform sampler2D s[];
6
7// unsized and statically indexed in earlier stage, explicitly sized with smaller index (but not indexed) in later stage
8// error: array is indexed with index (20) greater than its size (2)
9uniform U0 {
10    vec4 a[2];
11} u0;
12
13// explicitly sized in earlier stage, unsized and statically indexed with larger index in later stage
14// error: array is indexed with index (12) greater than its size (5)
15uniform U1 {
16    vec4 a[];
17} u1;
18
19// explicitly sized (3) and not indexed in earlier stage, explicitly sized with different size (5) and not indexed in later stage
20// error: array size in earlier stage (3) does not array size in later stage (5)
21buffer B0 {
22    vec4 a[5];
23} b0;
24
25// explicitly sized in earlier stage, unsized and statically indexed with larger index in later stage
26// error: array is indexed with index (4) greater than its size (3)
27buffer B1 {
28    vec4 a[];
29} b1;
30
31// explicitly sized in earlier stage, unsized and statically indexed with larger index in later stage
32// error: array is indexed with index (4) greater than its size (2)
33buffer B2 {
34    vec4 a[];
35} b2[2];
36
37in vec4 out_VS;
38out vec4 o;
39
40void main() {
41    o = texture(s[6], out_VS.xy);
42    o = u1.a[12];
43    o = b1.a[4];
44}