2017-01-31 03:55:21 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
|
|
|
|
using namespace metal;
|
|
|
|
|
|
|
|
struct Buffer
|
|
|
|
{
|
|
|
|
float4x4 MVPRowMajor;
|
|
|
|
float4x4 MVPColMajor;
|
|
|
|
float4x4 M;
|
|
|
|
};
|
|
|
|
|
2018-06-12 15:41:35 +00:00
|
|
|
struct main0_out
|
2017-01-31 03:55:21 +00:00
|
|
|
{
|
2018-06-12 15:41:35 +00:00
|
|
|
float4 gl_Position [[position]];
|
2017-01-31 03:55:21 +00:00
|
|
|
};
|
|
|
|
|
2018-06-12 15:41:35 +00:00
|
|
|
struct main0_in
|
2017-01-31 03:55:21 +00:00
|
|
|
{
|
2018-06-12 15:41:35 +00:00
|
|
|
float4 Position [[attribute(0)]];
|
2017-01-31 03:55:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
vertex main0_out main0(main0_in in [[stage_in]], constant Buffer& _13 [[buffer(0)]])
|
|
|
|
{
|
|
|
|
main0_out out = {};
|
|
|
|
float4 c0 = _13.M * (in.Position * _13.MVPRowMajor);
|
|
|
|
float4 c1 = _13.M * (_13.MVPColMajor * in.Position);
|
|
|
|
float4 c2 = _13.M * (_13.MVPRowMajor * in.Position);
|
|
|
|
float4 c3 = _13.M * (in.Position * _13.MVPColMajor);
|
|
|
|
out.gl_Position = ((c0 + c1) + c2) + c3;
|
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|