| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct Foo |
| 7 |
{ |
| 8 |
float4x4 m; |
| 9 |
}; |
| 10 |
|
| 11 |
struct SSBO2 |
| 12 |
{ |
| 13 |
Foo out_data[1]; |
| 14 |
}; |
| 15 |
|
| 16 |
struct SSBO |
| 17 |
{ |
| 18 |
Foo in_data[1]; |
| 19 |
}; |
| 20 |
|
| 21 |
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); |
| 22 |
|
| 23 |
kernel void main0(device SSBO2& _23 [[buffer(0)]], const device SSBO& _30 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) |
| 24 |
{ |
| 25 |
uint ident = gl_GlobalInvocationID.x; |
| 26 |
_23.out_data[ident].m = _30.in_data[ident].m * _30.in_data[ident].m; |
| 27 |
} |
| 28 |
|