| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct SSBO2 |
| 7 |
{ |
| 8 |
float4 out_data[1]; |
| 9 |
}; |
| 10 |
|
| 11 |
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); |
| 12 |
|
| 13 |
kernel void main0(device SSBO2& _27 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) |
| 14 |
{ |
| 15 |
uint ident = gl_GlobalInvocationID.x; |
| 16 |
if (ident == 2u) |
| 17 |
{ |
| 18 |
_27.out_data[ident] = float4(20.0); |
| 19 |
} |
| 20 |
else |
| 21 |
{ |
| 22 |
if (ident == 4u) |
| 23 |
{ |
| 24 |
_27.out_data[ident] = float4(10.0); |
| 25 |
return; |
| 26 |
} |
| 27 |
} |
| 28 |
int i = 0; |
| 29 |
while (i < 20) |
| 30 |
{ |
| 31 |
if (i == 10) |
| 32 |
{ |
| 33 |
break; |
| 34 |
} |
| 35 |
return; |
| 36 |
} |
| 37 |
_27.out_data[ident] = float4(10.0); |
| 38 |
} |
| 39 |
|