| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct SSBO0 |
| 7 |
{ |
| 8 |
short4 inputs[1]; |
| 9 |
}; |
| 10 |
|
| 11 |
struct SSBO1 |
| 12 |
{ |
| 13 |
int4 outputs[1]; |
| 14 |
}; |
| 15 |
|
| 16 |
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); |
| 17 |
|
| 18 |
kernel void main0(device SSBO0& _25 [[buffer(0)]], device SSBO1& _39 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) |
| 19 |
{ |
| 20 |
uint ident = gl_GlobalInvocationID.x; |
| 21 |
half2 a = as_type<half2>(_25.inputs[ident].xy); |
| 22 |
((device int*)&_39.outputs[ident])[0u] = int(as_type<uint>(a + half2(half(1.0)))); |
| 23 |
((device int*)&_39.outputs[ident])[1u] = as_type<int>(_25.inputs[ident].zw); |
| 24 |
((device int*)&_39.outputs[ident])[2u] = int(as_type<uint>(ushort2(_25.inputs[ident].xy))); |
| 25 |
} |
| 26 |
|