SPIRV-Cross/reference/shaders-msl/flatten/multiindex.flatten.vert
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

28 lines
413 B
GLSL

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct UBO
{
float4 Data[3][5];
};
struct main0_out
{
float4 gl_Position [[position]];
};
struct main0_in
{
int2 aIndex [[attribute(0)]];
};
vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _20 [[buffer(0)]])
{
main0_out out = {};
out.gl_Position = _20.Data[in.aIndex.x][in.aIndex.y];
return out;
}