third_party/spirv-cross/reference/shaders-msl-no-opt/packing/struct-alignment.comp
raw| 1 | #include <metal_stdlib> |
| 2 | #include <simd/simd.h> |
| 3 | |
| 4 | using namespace metal; |
| 5 | |
| 6 | struct Foo |
| 7 | { |
| 8 | packed_float3 a; |
| 9 | float b; |
| 10 | }; |
| 11 | |
| 12 | struct SSBO |
| 13 | { |
| 14 | float2 a; |
| 15 | float b; |
| 16 | char _m2_pad[4]; |
| 17 | Foo foo; |
| 18 | }; |
| 19 | |
| 20 | constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); |
| 21 | |
| 22 | kernel void main0(device SSBO& _12 [[buffer(0)]]) |
| 23 | { |
| 24 | ((device float*)&_12.a)[0u] = 10.0; |
| 25 | _12.b = 20.0; |
| 26 | } |
| 27 |