blob: 99456b9f01e5586c099ab652243e8a0f661f4a46 [file] [log] [blame]
John Kessenich6c292d32016-02-15 20:58:50 -07001#version 450
2
3layout(input_attachment_index = 2) uniform subpassInput subD1; // ERROR, not this stage
4layout(input_attachment_index = 2) uniform isubpassInput subD2; // ERROR, not this stage
5layout(input_attachment_index = 2) uniform usubpassInput subD3; // ERROR, not this stage
6layout(input_attachment_index = 2) uniform subpassInputMS subD4; // ERROR, not this stage
7layout(input_attachment_index = 2) uniform isubpassInputMS subD5; // ERROR, not this stage
8layout(input_attachment_index = 2) uniform usubpassInputMS subD6; // ERROR, not this stage
9
10out vec4 color;
11
12layout(constant_id = 17) const ivec2 arraySizes = ivec2(12,13); // ERROR, not a scalar
13layout(constant_id = 17) uniform sampler2D s2D; // ERROR, not the right type or qualifier
14layout(constant_id = 4000) const int c1 = 12; // ERROR, too big
15layout(constant_id = 4) const float c2[2] = float[2](1.0, 2.0); // ERROR, not a scalar
16layout(constant_id = 4) in;
17
18void main()
19{
20 color = subpassLoad(subD1); // ERROR, no such function in this stage
21}
22
23layout(binding = 0) uniform atomic_uint aui; // ERROR, no atomics in Vulkan
24layout(shared) uniform ub1n { int a; } ub1i; // ERROR, no shared
25layout(packed) uniform ub2n { int a; } ub2i; // ERROR, no packed
26
27layout(constant_id=222) const int arraySize = 4;
28
29void foo()
30{
31 int a1[arraySize];
32 int a2[arraySize] = a1; // ERROR, can't use in initializer
33
34 a1 = a2; // ERROR, can't assign, even though the same type
35 if (a1 == a2) // ERROR, can't compare either
36 ++color;
John Kessenichf7497e22016-03-08 21:36:22 -070037}
38
39layout(set = 1, push_constant) uniform badpc { int a; } badpcI; // ERROR, no descriptor set with push_constant
John Kesseniche512cd92016-05-03 21:17:55 -060040
41#ifndef VULKAN
42#error VULKAN should be defined
43#endif
44
45#if VULKAN != 100
46#error VULKAN should be 100
47#endif
John Kessenich3fcb42c2017-06-08 12:26:49 -060048
Jeff Bolz4605e2e2019-02-19 13:10:32 -060049float AofA0[2][arraySize];
50float AofA1[arraySize][arraySize];
51float AofA2[arraySize][2 + arraySize];
John Kessenich3fcb42c2017-06-08 12:26:49 -060052float AofA3[arraySize][2];
53
54out ban1 { // ERROR, only outer dimension
55 float f;
56} bai1[2][arraySize];
57
58out ban2 {
59 float f;
60} bai2[arraySize][2];
John Kessenichac516022017-11-01 22:33:45 -060061
62layout(binding = 3000) uniform sampler2D s3000;
63layout(binding = 3001) uniform b3001 { int a; };
John Kessenich0f8d43e2018-04-12 11:37:57 -060064layout(location = 10) in vec4 in1;
65layout(location = 10) in vec4 in2; // ERROR, no location aliasing
John Kessenich5cb2fa22019-05-03 08:40:35 -060066
67layout(constant_id = 400) const int nonLit = 1;
68layout(location = nonLit, component = nonLit) in vec4 nonLit1; // ERROR, non literal
69layout(binding = nonLit, set = nonLit) uniform nonLitBN { // ERROR, non literal
70 layout(offset = nonLit) vec4 nonLit1; // ERROR, non literal
71 layout(align = nonLit) vec4 nonLit3; // ERROR, non literal
72 layout(xfb_offset = nonLit) vec4 nonLit4; // ERROR, non literal
73 layout(xfb_buffer = nonLit) vec4 nonLit5; // ERROR, non literal
74 layout(xfb_stride = nonLit) vec4 nonLit6; // ERROR, non literal
75} nonLitBI;
76layout(input_attachment_index = nonLit) vec4 nonLit3; // ERROR, non literal
77layout(constant_id = nonLit) vec4 nonLit4; // ERROR, non literal