| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct SSBO |
| 7 |
{ |
| 8 |
float4x4 mvp; |
| 9 |
float4 in_data[1]; |
| 10 |
}; |
| 11 |
|
| 12 |
struct SSBO2 |
| 13 |
{ |
| 14 |
float4 out_data[1]; |
| 15 |
}; |
| 16 |
|
| 17 |
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); |
| 18 |
|
| 19 |
kernel void main0(const device SSBO& _28 [[buffer(0)]], device SSBO2& _52 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) |
| 20 |
{ |
| 21 |
float4 _59; |
| 22 |
int _60; |
| 23 |
_60 = 0; |
| 24 |
_59 = _28.in_data[gl_GlobalInvocationID.x]; |
| 25 |
float4 _42; |
| 26 |
for (;;) |
| 27 |
{ |
| 28 |
_42 = _28.mvp * _59; |
| 29 |
int _44 = _60 + 1; |
| 30 |
if (_44 < 16) |
| 31 |
{ |
| 32 |
_60 = _44; |
| 33 |
_59 = _42; |
| 34 |
} |
| 35 |
else |
| 36 |
{ |
| 37 |
break; |
| 38 |
} |
| 39 |
} |
| 40 |
_52.out_data[gl_GlobalInvocationID.x] = _42; |
| 41 |
} |
| 42 |
|