SPIRV-Cross/reference/shaders-msl-no-opt/comp/buffer-device-address-from-pointer-complex-chain.msl23.comp

29 lines
342 B
Plaintext
Raw Normal View History

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct SSBO;
struct S
{
float3 v;
};
struct SSBO
{
S s[1];
};
struct PC
{
uint2 ptr;
};
kernel void main0(constant PC& pc [[buffer(0)]])
{
device SSBO* ssbo = reinterpret_cast<device SSBO*>(as_type<ulong>(pc.ptr));
ssbo->s[0].v = float3(1.0);
}