2022-07-01 20:10:41 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
|
|
|
|
using namespace metal;
|
|
|
|
|
|
|
|
struct SSBO;
|
|
|
|
|
|
|
|
struct UBO
|
|
|
|
{
|
|
|
|
uint2 b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SSBO
|
|
|
|
{
|
|
|
|
packed_float3 a1;
|
|
|
|
float a2;
|
|
|
|
};
|
|
|
|
|
|
|
|
kernel void main0(constant UBO& _10 [[buffer(0)]])
|
|
|
|
{
|
2022-08-09 11:48:28 +00:00
|
|
|
(reinterpret_cast<device SSBO*>(as_type<ulong>(_10.b)))->a1 = float3(1.0, 2.0, 3.0);
|
|
|
|
uint2 v2 = as_type<uint2>(reinterpret_cast<ulong>(reinterpret_cast<device SSBO*>(as_type<ulong>(_10.b + uint2(32u)))));
|
|
|
|
float3 v3 = float3((reinterpret_cast<device SSBO*>(as_type<ulong>(v2)))->a1);
|
|
|
|
(reinterpret_cast<device SSBO*>(as_type<ulong>(v2)))->a1 = v3 + float3(1.0);
|
2022-07-01 20:10:41 +00:00
|
|
|
}
|
|
|
|
|