Welcome to mirror list, hosted at ThFree Co, Russian Federation.

buffer_device_address-packed-vec-and-cast-to-and-from-uvec2.msl23.comp « comp « shaders-msl « reference - github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 474d5092baebe9e4a729ebbcd7eabf791c7cf4c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#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)]])
{
    ((device SSBO*)as_type<uint64_t>(_10.b))->a1 = float3(1.0, 2.0, 3.0);
    uint2 v2 = as_type<uint2>((uint64_t)((device SSBO*)as_type<uint64_t>(_10.b + uint2(32u))));
    float3 v3 = float3(((device SSBO*)as_type<uint64_t>(v2))->a1);
    ((device SSBO*)as_type<uint64_t>(v2))->a1 = v3 + float3(1.0);
}