SPIRV-Cross/reference/shaders-msl/asm/comp/relaxed-block-layout.asm.comp
Chip Davis bed4918cb5 MSL: Also pack 2- and 4- element vectors when necessary.
This is also needed for `VK_KHR_relaxed_block_layout` support.
2018-11-13 17:31:47 -06:00

21 lines
445 B
Plaintext

#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& _6 [[buffer(0)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
{
_6.bar = gl_LocalInvocationID.x;
_6.baz = float3(gl_GlobalInvocationID);
}