| 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; |
| 14 |
float4 gl_Position; |
| 15 |
}; |
| 16 |
|
| 17 |
struct main0_in |
| 18 |
{ |
| 19 |
float4 aVertex [[attribute(0)]]; |
| 20 |
float3 aNormal [[attribute(1)]]; |
| 21 |
}; |
| 22 |
|
| 23 |
kernel void main0(main0_in in [[stage_in]], constant UBO& _16 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint3 spvStageInputSize [[grid_size]], device main0_out* spvOut [[buffer(28)]]) |
| 24 |
{ |
| 25 |
device main0_out& out = spvOut[gl_GlobalInvocationID.y * spvStageInputSize.x + gl_GlobalInvocationID.x]; |
| 26 |
if (any(gl_GlobalInvocationID >= spvStageInputSize)) |
| 27 |
return; |
| 28 |
out.gl_Position = _16.uMVP * in.aVertex; |
| 29 |
out.vNormal = in.aNormal; |
| 30 |
} |
| 31 |
|