2018-11-07 06:31:11 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
|
|
|
|
using namespace metal;
|
|
|
|
|
|
|
|
struct foo
|
|
|
|
{
|
|
|
|
uint bar;
|
|
|
|
packed_float3 baz;
|
2018-11-09 19:14:52 +00:00
|
|
|
uchar quux;
|
|
|
|
packed_uchar4 blah;
|
|
|
|
packed_half2 wibble;
|
2018-11-07 06:31:11 +00:00
|
|
|
};
|
|
|
|
|
2018-11-14 16:47:20 +00:00
|
|
|
kernel void main0(device foo& _8 [[buffer(0)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]], uint3 gl_NumWorkGroups [[threadgroups_per_grid]])
|
2018-11-07 06:31:11 +00:00
|
|
|
{
|
2018-11-14 16:47:20 +00:00
|
|
|
_8.bar = gl_LocalInvocationID.x;
|
|
|
|
_8.baz = float3(gl_GlobalInvocationID);
|
|
|
|
_8.blah = uchar4(uint4(uint4(uchar4(_8.blah)).xyz + gl_WorkGroupID, 0u));
|
|
|
|
_8.wibble = half2(float2(half2(_8.wibble)) * float2(gl_NumWorkGroups.xy));
|
2018-11-07 06:31:11 +00:00
|
|
|
}
|
|
|
|
|