• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 450 core
2
3buffer bn {
4    int a[];
5    float b[];
6} buf;
7
8uniform un {
9    int a[];
10    float b[];
11} ubuf;
12
13buffer bna {
14    int a[];
15    float b[];
16} bufa[4];
17
18uniform una {
19    int a[];
20    float b[];
21} ubufa[4];
22
23buffer abn {
24    int aba[];
25    float abb[];
26};
27
28uniform aun {
29    int aua[];
30    float aub[];
31};
32
33layout(binding=1)                             uniform samplerBuffer       uniformTexelBufferDyn[];
34layout(binding=2, r32f)                       uniform imageBuffer         storageTexelBufferDyn[];
35layout(binding=3)                             uniform uname { float a; }  uniformBuffer[];
36layout(binding=4)                             buffer  bname { float b; }  storageBuffer[];
37layout(binding=5)                             uniform sampler2D           sampledImage[];
38layout(binding=6, r32f)                       uniform image2D             storageImage[];
39layout(binding=8)                             uniform samplerBuffer       uniformTexelBuffer[];
40layout(binding=9, r32f)                       uniform imageBuffer         storageTexelBuffer[];
41
42int i;
43
44void main()
45{
46    ubuf.a[3];
47    ubuf.b[3];
48    buf.a[3];
49    buf.b[3];
50
51    ubufa[3].a[3];
52    ubufa[3].b[3];
53    bufa[3].a[3];
54    bufa[3].b[3];
55
56    aua[3];
57    aub[3];
58    aba[3];
59    abb[3];
60
61    ubuf.a[i];             // ERROR
62    ubuf.b[i];             // ERROR
63    buf.a[i];              // ERROR
64    buf.b[i];
65
66    ubuf.a.length();       // ERROR
67    ubuf.b.length();       // ERROR
68    buf.a.length();        // ERROR
69    buf.b.length();
70
71    ubufa[1].a[i];         // ERROR
72    ubufa[1].b[i];         // ERROR
73    bufa[1].a[i];          // ERROR
74    bufa[1].b[i];
75
76    ubufa[1].a.length();   // ERROR
77    ubufa[1].b.length();   // ERROR
78    bufa[1].a.length();    // ERROR
79    bufa[1].b.length();
80
81    aua[i];                // ERROR
82    aub[i];                // ERROR
83    aba[i];                // ERROR
84    abb[i];
85
86    aua.length();          // ERROR
87    aub.length();          // ERROR
88    aba.length();          // ERROR
89    abb.length();
90
91    uniformTexelBufferDyn[1];
92    storageTexelBufferDyn[1];
93    uniformBuffer[1];
94    storageBuffer[1];
95    sampledImage[1];
96    storageImage[1];
97    uniformTexelBuffer[1];
98    storageTexelBuffer[1];
99
100    uniformTexelBufferDyn[i];  // ERROR, need extension
101    storageTexelBufferDyn[i];  // ERROR, need extension
102    uniformBuffer[i];          // ERROR, need extension
103    storageBuffer[i];          // ERROR, need extension
104    sampledImage[i];           // ERROR, need extension
105    storageImage[i];           // ERROR, need extension
106    uniformTexelBuffer[i];     // ERROR, need extension
107    storageTexelBuffer[i];     // ERROR, need extension
108
109    float local[] = ubuf.b;    // ERROR, can initialize with runtime-sized array
110}
111