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