| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct buf |
| 7 |
{ |
| 8 |
float4x4 MVP; |
| 9 |
float4 position[36]; |
| 10 |
float4 attr[36]; |
| 11 |
}; |
| 12 |
|
| 13 |
struct main0_out |
| 14 |
{ |
| 15 |
float4 texcoord [[user(locn0)]]; |
| 16 |
float3 frag_pos [[user(locn1)]]; |
| 17 |
float4 gl_Position [[position]]; |
| 18 |
}; |
| 19 |
|
| 20 |
vertex main0_out main0(constant buf& ubuf [[buffer(0)]], uint gl_VertexIndex [[vertex_id]]) |
| 21 |
{ |
| 22 |
main0_out out = {}; |
| 23 |
out.texcoord = ubuf.attr[int(gl_VertexIndex)]; |
| 24 |
out.gl_Position = ubuf.MVP * ubuf.position[int(gl_VertexIndex)]; |
| 25 |
out.frag_pos = out.gl_Position.xyz; |
| 26 |
return out; |
| 27 |
} |
| 28 |
|