#pragma clang diagnostic ignored "-Wmissing-prototypes" #pragma clang diagnostic ignored "-Wmissing-braces" #include #include using namespace metal; template struct spvUnsafeArray { T elements[Num ? Num : 1]; thread T& operator [] (size_t pos) thread { return elements[pos]; } constexpr const thread T& operator [] (size_t pos) const thread { return elements[pos]; } device T& operator [] (size_t pos) device { return elements[pos]; } constexpr const device T& operator [] (size_t pos) const device { return elements[pos]; } constexpr const constant T& operator [] (size_t pos) const constant { return elements[pos]; } threadgroup T& operator [] (size_t pos) threadgroup { return elements[pos]; } constexpr const threadgroup T& operator [] (size_t pos) const threadgroup { return elements[pos]; } }; struct BUF { int a; float b; float c; }; constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); constant spvUnsafeArray _16 = spvUnsafeArray({ 1.0, 2.0 }); constant spvUnsafeArray _19 = spvUnsafeArray({ 3.0, 4.0 }); constant spvUnsafeArray, 2> _20 = spvUnsafeArray, 2>({ spvUnsafeArray({ 1.0, 2.0 }), spvUnsafeArray({ 3.0, 4.0 }) }); constant spvUnsafeArray, 2>, 2> _21 = spvUnsafeArray, 2>, 2>({ spvUnsafeArray, 2>({ spvUnsafeArray({ 1.0, 2.0 }), spvUnsafeArray({ 3.0, 4.0 }) }), spvUnsafeArray, 2>({ spvUnsafeArray({ 1.0, 2.0 }), spvUnsafeArray({ 3.0, 4.0 }) }) }); kernel void main0(device BUF& o [[buffer(0)]]) { spvUnsafeArray, 2>, 2> c = _21; o.a = int(c[1][1][1]); spvUnsafeArray _43 = spvUnsafeArray({ o.b, o.c }); spvUnsafeArray _48 = spvUnsafeArray({ o.b, o.b }); spvUnsafeArray, 2> _49 = spvUnsafeArray, 2>({ _43, _48 }); spvUnsafeArray _54 = spvUnsafeArray({ o.c, o.c }); spvUnsafeArray _59 = spvUnsafeArray({ o.c, o.b }); spvUnsafeArray, 2> _60 = spvUnsafeArray, 2>({ _54, _59 }); spvUnsafeArray, 2>, 2> _61 = spvUnsafeArray, 2>, 2>({ _49, _60 }); spvUnsafeArray, 2>, 2> d = _61; spvUnsafeArray, 2>, 2> e = d; o.b = e[1][0][1]; }