| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct SSBO1 |
| 7 |
{ |
| 8 |
short4 outputs[1]; |
| 9 |
}; |
| 10 |
|
| 11 |
struct SSBO0 |
| 12 |
{ |
| 13 |
int4 inputs[1]; |
| 14 |
}; |
| 15 |
|
| 16 |
struct UBO |
| 17 |
{ |
| 18 |
half4 const0; |
| 19 |
}; |
| 20 |
|
| 21 |
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); |
| 22 |
|
| 23 |
kernel void main0(device SSBO1& _21 [[buffer(0)]], device SSBO0& _29 [[buffer(1)]], constant UBO& _40 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) |
| 24 |
{ |
| 25 |
uint ident = gl_GlobalInvocationID.x; |
| 26 |
short2 _47 = as_type<short2>(((device int*)&_29.inputs[ident])[0u]) + as_type<short2>(_40.const0.xy); |
| 27 |
_21.outputs[ident] = short4(_47.x, _47.y, _21.outputs[ident].z, _21.outputs[ident].w); |
| 28 |
short2 _66 = short2(as_type<ushort2>(uint(((device int*)&_29.inputs[ident])[1u])) - as_type<ushort2>(_40.const0.zw)); |
| 29 |
_21.outputs[ident] = short4(_21.outputs[ident].x, _21.outputs[ident].y, _66.x, _66.y); |
| 30 |
} |
| 31 |
|