| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct A |
| 7 |
{ |
| 8 |
float v; |
| 9 |
char _m0_final_padding[12]; |
| 10 |
}; |
| 11 |
|
| 12 |
struct B |
| 13 |
{ |
| 14 |
float2 v; |
| 15 |
char _m0_final_padding[8]; |
| 16 |
}; |
| 17 |
|
| 18 |
struct C |
| 19 |
{ |
| 20 |
float3 v; |
| 21 |
}; |
| 22 |
|
| 23 |
struct D |
| 24 |
{ |
| 25 |
float4 v; |
| 26 |
}; |
| 27 |
|
| 28 |
struct E |
| 29 |
{ |
| 30 |
float4 a; |
| 31 |
float2 b; |
| 32 |
char _m0_final_padding[8]; |
| 33 |
}; |
| 34 |
|
| 35 |
struct SSBO |
| 36 |
{ |
| 37 |
A a[4]; |
| 38 |
B b[4]; |
| 39 |
C c[4]; |
| 40 |
D d[4]; |
| 41 |
float2x4 e[4]; |
| 42 |
E f[1]; |
| 43 |
}; |
| 44 |
|
| 45 |
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); |
| 46 |
|
| 47 |
kernel void main0(device SSBO& _26 [[buffer(0)]]) |
| 48 |
{ |
| 49 |
_26.f[0].a = float4(2.0); |
| 50 |
float2x2 tmp = float2x2(_26.e[1][0].xy, _26.e[1][1].xy); |
| 51 |
(device float2&)_26.e[2][0] = tmp[0]; |
| 52 |
(device float2&)_26.e[2][1] = tmp[1]; |
| 53 |
} |
| 54 |
|