1#include <metal_stdlib> 2#include <simd/simd.h> 3 4using namespace metal; 5 6struct foo 7{ 8 uint bar; 9 packed_float3 baz; 10 uchar quux; 11 packed_uchar4 blah; 12 packed_half2 wibble; 13}; 14 15kernel 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]]) 16{ 17 _8.bar = gl_LocalInvocationID.x; 18 _8.baz = float3(gl_GlobalInvocationID); 19 _8.blah = uchar4(uint4(uint4(uchar4(_8.blah)).xyz + gl_WorkGroupID, 0u)); 20 _8.wibble = half2(float2(half2(_8.wibble)) * float2(gl_NumWorkGroups.xy)); 21} 22 23