| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct UBO |
| 7 |
{ |
| 8 |
float4x4 uMVP; |
| 9 |
}; |
| 10 |
|
| 11 |
struct main0_out |
| 12 |
{ |
| 13 |
float3 vNormal [[user(locn0)]]; |
| 14 |
float4 gl_Position [[position]]; |
| 15 |
}; |
| 16 |
|
| 17 |
struct main0_in |
| 18 |
{ |
| 19 |
float4 aVertex [[attribute(0)]]; |
| 20 |
float3 aNormal [[attribute(1)]]; |
| 21 |
}; |
| 22 |
|
| 23 |
vertex void main0(main0_in in [[stage_in]], constant UBO& _16 [[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)]]) |
| 24 |
{ |
| 25 |
device main0_out& out = spvOut[(gl_InstanceIndex - gl_BaseInstance) * spvIndirectParams[0] + gl_VertexIndex - gl_BaseVertex]; |
| 26 |
out.gl_Position = _16.uMVP * in.aVertex; |
| 27 |
out.vNormal = in.aNormal; |
| 28 |
} |
| 29 |
|