SPIRV-Cross/reference/shaders-msl/vert/packed-bool-to-uint.vert
Hans-Kristian Arntzen 107ab7c2b7 MSL: Avoid packed arrays in more cases.
Extend the array stride relaxation to non-packed arrays as well, as
long as the array in question contains a single array element.
2020-05-06 10:27:12 +02:00

39 lines
726 B
GLSL

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct Struct
{
uint flags[1];
};
struct defaultUniformsVS
{
Struct flags;
float4 uquad[4];
float4x4 umatrix;
};
struct main0_out
{
float4 gl_Position [[position]];
};
struct main0_in
{
float4 a_position [[attribute(0)]];
};
vertex main0_out main0(main0_in in [[stage_in]], constant defaultUniformsVS& _24 [[buffer(0)]], uint gl_VertexIndex [[vertex_id]])
{
main0_out out = {};
out.gl_Position = _24.umatrix * float4(_24.uquad[int(gl_VertexIndex)].x, _24.uquad[int(gl_VertexIndex)].y, in.a_position.z, in.a_position.w);
if (_24.flags.flags[0] != 0u)
{
out.gl_Position.z = 0.0;
}
return out;
}