| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct T1 |
| 7 |
{ |
| 8 |
packed_float3 a; |
| 9 |
float b; |
| 10 |
}; |
| 11 |
|
| 12 |
struct Buffer0 |
| 13 |
{ |
| 14 |
T1 buf0[1]; |
| 15 |
}; |
| 16 |
|
| 17 |
struct Buffer1 |
| 18 |
{ |
| 19 |
float buf1[1]; |
| 20 |
}; |
| 21 |
|
| 22 |
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(32u, 1u, 1u); |
| 23 |
|
| 24 |
kernel void main0(device Buffer0& _14 [[buffer(0)]], device Buffer1& _24 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) |
| 25 |
{ |
| 26 |
float x = _14.buf0[0].b; |
| 27 |
_24.buf1[gl_GlobalInvocationID.x] = x; |
| 28 |
} |
| 29 |
|