Debian Codegraph @

third_party/spirv-cross/shaders-msl-no-opt/packing/struct-alignment.comp

raw
1 #version 450
2 layout(local_size_x = 1) in;
3
4 struct Foo
5 {
6 vec3 a; // <- This one should become packed_float3, and the MSL alignment of the struct is now 4.
7 float b;
8 };
9
10 layout(std140, set = 0, binding = 0) buffer SSBO
11 {
12 vec2 a;
13 float b;
14 // <- We expect 4 bytes of padding here since MSL alignment of Foo must be lowered to 4.
15 Foo foo;
16 };
17
18 void main()
19 {
20 a.x = 10.0;
21 b = 20.0;
22 }