| 1 |
#pragma clang diagnostic ignored "-Wmissing-prototypes" |
| 2 |
|
| 3 |
#include <metal_stdlib> |
| 4 |
#include <simd/simd.h> |
| 5 |
|
| 6 |
using namespace metal; |
| 7 |
|
| 8 |
struct UBO |
| 9 |
{ |
| 10 |
float4x4 uMVP; |
| 11 |
}; |
| 12 |
|
| 13 |
struct main0_out |
| 14 |
{ |
| 15 |
float3 vNormal [[user(locn0)]]; |
| 16 |
float4 gl_Position [[position]]; |
| 17 |
}; |
| 18 |
|
| 19 |
struct main0_in |
| 20 |
{ |
| 21 |
float4 aVertex [[attribute(0)]]; |
| 22 |
float3 aNormal [[attribute(1)]]; |
| 23 |
}; |
| 24 |
|
| 25 |
static inline __attribute__((always_inline)) |
| 26 |
void set_output(device float4& gl_Position, constant UBO& v_18, thread float4& aVertex, device float3& vNormal, thread float3& aNormal) |
| 27 |
{ |
| 28 |
gl_Position = v_18.uMVP * aVertex; |
| 29 |
vNormal = aNormal; |
| 30 |
} |
| 31 |
|
| 32 |
vertex void main0(main0_in in [[stage_in]], constant UBO& v_18 [[buffer(0)]], uint gl_VertexIndex [[vertex_id]], uint gl_BaseVertex [[base_vertex]], uint gl_InstanceIndex [[instance_id]], uint gl_BaseInstance [[base_instance]], device main0_out* spvOut [[buffer(28)]], device uint* spvIndirectParams [[buffer(29)]]) |
| 33 |
{ |
| 34 |
device main0_out& out = spvOut[(gl_InstanceIndex - gl_BaseInstance) * spvIndirectParams[0] + gl_VertexIndex - gl_BaseVertex]; |
| 35 |
set_output(out.gl_Position, v_18, in.aVertex, out.vNormal, in.aNormal); |
| 36 |
} |
| 37 |
|