| // | |
| // vtx_main | |
| // | |
| #include <metal_stdlib> | |
| using namespace metal; | |
| struct vtx_main_outputs { | |
| float4 tint_symbol [[position]]; | |
| }; | |
| const constant array<float2, 3> v = array<float2, 3>{float2(0.0f, 0.5f), float2(-0.5f), float2(0.5f, -0.5f)}; | |
| float4 vtx_main_inner(uint VertexIndex) { | |
| return float4(v[min(VertexIndex, 2u)], 0.0f, 1.0f); | |
| } | |
| vertex vtx_main_outputs vtx_main(uint VertexIndex [[vertex_id]]) { | |
| vtx_main_outputs tint_wrapper_result = {}; | |
| tint_wrapper_result.tint_symbol = vtx_main_inner(VertexIndex); | |
| return tint_wrapper_result; | |
| } | |
| // | |
| // frag_main | |
| // | |
| #include <metal_stdlib> | |
| using namespace metal; | |
| struct frag_main_outputs { | |
| float4 tint_symbol [[color(0)]]; | |
| }; | |
| float4 frag_main_inner() { | |
| return float4(1.0f, 0.0f, 0.0f, 1.0f); | |
| } | |
| fragment frag_main_outputs frag_main() { | |
| frag_main_outputs tint_wrapper_result = {}; | |
| tint_wrapper_result.tint_symbol = frag_main_inner(); | |
| return tint_wrapper_result; | |
| } |