SPIRV-Cross/reference/shaders-msl-no-opt/asm/comp/aliased-struct-divergent-member-name.asm.comp
Hans-Kristian Arntzen d1479f871a MSL: Do not generate UnsafeArray<> for any array inside buffer objects.
This avoids a lot of huge code changes.
Arrays generally cannot be copied in and out of buffers, at least no
compiler frontend seems to do it.

Also avoids a lot of issues surrounding packed vectors and matrices.
2019-10-24 12:22:30 +02:00

39 lines
420 B
Plaintext

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct T
{
float a;
};
struct T_1
{
float b;
};
struct SSBO1
{
T_1 foo[1];
};
struct T_2
{
float c;
char _m0_final_padding[12];
};
struct SSBO2
{
T_2 bar[1];
};
kernel void main0(device SSBO1& _7 [[buffer(0)]], device SSBO2& _10 [[buffer(1)]])
{
T v = T{ 40.0 };
_7.foo[10].b = v.a;
_10.bar[30].c = v.a;
}