SPIRV-Cross/reference/shaders-msl/asm/comp/relaxed-block-layout.asm.comp

23 lines
707 B
Plaintext
Raw Normal View History

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct foo
{
uint bar;
packed_float3 baz;
uchar quux;
packed_uchar4 blah;
packed_half2 wibble;
};
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]])
{
_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));
}