Merge pull request #2865 from alan-baker/update-license
[platform/upstream/glslang.git] / Test / vulkan.vert
1 #version 450\r
2 \r
3 layout(input_attachment_index = 2) uniform subpassInput subD1;     // ERROR, not this stage\r
4 layout(input_attachment_index = 2) uniform isubpassInput subD2;    // ERROR, not this stage\r
5 layout(input_attachment_index = 2) uniform usubpassInput subD3;    // ERROR, not this stage\r
6 layout(input_attachment_index = 2) uniform subpassInputMS subD4;   // ERROR, not this stage\r
7 layout(input_attachment_index = 2) uniform isubpassInputMS subD5;  // ERROR, not this stage\r
8 layout(input_attachment_index = 2) uniform usubpassInputMS subD6;  // ERROR, not this stage\r
9 \r
10 out vec4 color;\r
11 \r
12 layout(constant_id = 17) const ivec2 arraySizes = ivec2(12,13);    // ERROR, not a scalar\r
13 layout(constant_id = 17) uniform sampler2D s2D;                    // ERROR, not the right type or qualifier\r
14 layout(constant_id = 4000) const int c1 = 12;                      // ERROR, too big\r
15 layout(constant_id = 4) const float c2[2] = float[2](1.0, 2.0);    // ERROR, not a scalar\r
16 layout(constant_id = 4) in;\r
17 \r
18 void main()\r
19 {\r
20     color = subpassLoad(subD1); // ERROR, no such function in this stage\r
21 }\r
22 \r
23 layout(binding = 0) uniform atomic_uint aui;   // ERROR, no atomics in Vulkan\r
24 layout(shared, binding = 1) uniform ub1n { int a; } ub1i;   // ERROR, no shared\r
25 layout(packed, binding = 2) uniform ub2n { int a; } ub2i;   // ERROR, no packed\r
26 \r
27 layout(constant_id=222) const int arraySize = 4;\r
28 \r
29 void foo()\r
30 {\r
31     int a1[arraySize];\r
32     int a2[arraySize] = a1;  // ERROR, can't use in initializer\r
33 \r
34     a1 = a2;      // ERROR, can't assign, even though the same type\r
35     if (a1 == a2) // ERROR, can't compare either\r
36         ++color;\r
37 }\r
38 \r
39 layout(set = 1, push_constant) uniform badpc { int a; } badpcI;  // ERROR, no descriptor set with push_constant\r
40 \r
41 #ifndef VULKAN\r
42 #error VULKAN should be defined\r
43 #endif\r
44 \r
45 #if VULKAN != 100\r
46 #error VULKAN should be 100\r
47 #endif\r
48 \r
49 float AofA0[2][arraySize];\r
50 float AofA1[arraySize][arraySize];\r
51 float AofA2[arraySize][2 + arraySize];\r
52 float AofA3[arraySize][2];\r
53 \r
54 out ban1 {                              // ERROR, only outer dimension\r
55     float f;\r
56 } bai1[2][arraySize];\r
57 \r
58 out ban2 {\r
59     float f;\r
60 } bai2[arraySize][2];\r
61 \r
62 layout(binding = 3000) uniform sampler2D s3000;\r
63 layout(binding = 3001) uniform b3001 { int a; };\r
64 layout(location = 10) in vec4 in1;\r
65 layout(location = 10) in vec4 in2;  // ERROR, no location aliasing\r
66 \r
67 layout(constant_id = 400) const int nonLit = 1;\r
68 layout(location = nonLit, component = nonLit) in vec4 nonLit1;  // ERROR, non literal\r
69 layout(binding = nonLit, set = nonLit) uniform nonLitBN {       // ERROR, non literal\r
70     layout(offset = nonLit) vec4 nonLit1;                       // ERROR, non literal\r
71     layout(align = nonLit) vec4 nonLit3;                        // ERROR, non literal\r
72     layout(xfb_offset = nonLit) vec4 nonLit4;                   // ERROR, non literal\r
73     layout(xfb_buffer = nonLit) vec4 nonLit5;                   // ERROR, non literal\r
74     layout(xfb_stride = nonLit) vec4 nonLit6;                   // ERROR, non literal\r
75 } nonLitBI;\r
76 layout(input_attachment_index = nonLit) vec4 nonLit3;           // ERROR, non literal\r
77 layout(constant_id = nonLit) vec4 nonLit4;                      // ERROR, non literal\r