SPIRV-Cross/shaders-msl-no-opt/packing/struct-alignment.comp
2019-07-23 11:46:34 +02:00

23 lines
383 B
Plaintext

#version 450
layout(local_size_x = 1) in;
struct Foo
{
vec3 a; // <- This one should become packed_float3, and the MSL alignment of the struct is now 4.
float b;
};
layout(std140, set = 0, binding = 0) buffer SSBO
{
vec2 a;
float b;
// <- We expect 4 bytes of padding here since MSL alignment of Foo must be lowered to 4.
Foo foo;
};
void main()
{
a.x = 10.0;
b = 20.0;
}