1#version 450
2
3#extension GL_EXT_buffer_reference : enable
4
5layout(buffer_reference) buffer bufType1 { int x; };
6layout(buffer_reference) buffer bufType2 { int x; };
7layout(buffer_reference) uniform bufType3 { int x; };
8
9layout(buffer_reference) buffer;
10layout(buffer_reference) uniform;
11layout(buffer_reference) in;
12layout(buffer_reference) out;
13layout(buffer_reference) in badin { float x; } badin2;
14layout(buffer_reference) out badout { float x; } badout2;
15
16layout(buffer_reference) buffer bufType5;
17
18layout(buffer_reference) buffer bufType6 { int x[]; };
19
20buffer bufType4 {
21    bufType1 b1;
22    bufType2 b2;
23    bufType3 b3;
24    bufType6 b6;
25} b4;
26
27void f()
28{
29    bufType6 b;
30    b.x.length();
31    b4.b6.x.length();
32    b[2];               // ERROR, can't index due to unsized array
33}
34
35void main() {
36    bufType2 x1 = b4.b1;
37    bufType2 x2 = bufType2(b4.b1);
38    bufType2 x3 = bufType2(b4.b2);
39    bufType2 x4 = bufType2(b4.b3);
40
41    b4.b1 = b4.b2;
42    b4.b1 = b4.b3;
43    b4.b3 = b4.b2;
44}
45
46layout(buffer_reference) uniform bufType5 { int x; };
47