Ben Clayton | d123267 | 2021-05-18 09:24:18 +0000 | [diff] [blame] | 1 | #include <metal_stdlib> |
| 2 | |
| 3 | using namespace metal; |
| 4 | struct Uniforms { |
| 5 | /* 0x0000 */ float4x4 modelViewProjectionMatrix; |
| 6 | }; |
Ben Clayton | 8ec32a6 | 2022-02-09 23:55:51 +0000 | [diff] [blame] | 7 | |
Ben Clayton | d123267 | 2021-05-18 09:24:18 +0000 | [diff] [blame] | 8 | struct VertexInput { |
| 9 | float4 cur_position; |
| 10 | float4 color; |
| 11 | }; |
Ben Clayton | 8ec32a6 | 2022-02-09 23:55:51 +0000 | [diff] [blame] | 12 | |
Ben Clayton | d123267 | 2021-05-18 09:24:18 +0000 | [diff] [blame] | 13 | struct VertexOutput { |
| 14 | float4 vtxFragColor; |
| 15 | float4 Position; |
| 16 | }; |
Ben Clayton | 8ec32a6 | 2022-02-09 23:55:51 +0000 | [diff] [blame] | 17 | |
Ben Clayton | d123267 | 2021-05-18 09:24:18 +0000 | [diff] [blame] | 18 | struct tint_symbol_1 { |
| 19 | float4 cur_position [[attribute(0)]]; |
| 20 | float4 color [[attribute(1)]]; |
| 21 | }; |
Ben Clayton | 8ec32a6 | 2022-02-09 23:55:51 +0000 | [diff] [blame] | 22 | |
Ben Clayton | d123267 | 2021-05-18 09:24:18 +0000 | [diff] [blame] | 23 | struct tint_symbol_2 { |
| 24 | float4 vtxFragColor [[user(locn0)]]; |
| 25 | float4 Position [[position]]; |
| 26 | }; |
Ben Clayton | d123267 | 2021-05-18 09:24:18 +0000 | [diff] [blame] | 27 | |
James Price | e548db9 | 2021-10-28 15:00:39 +0000 | [diff] [blame] | 28 | VertexOutput vtx_main_inner(VertexInput input, const constant Uniforms* const tint_symbol_7) { |
Ben Clayton | d123267 | 2021-05-18 09:24:18 +0000 | [diff] [blame] | 29 | VertexOutput output = {}; |
James Price | e548db9 | 2021-10-28 15:00:39 +0000 | [diff] [blame] | 30 | output.Position = ((*(tint_symbol_7)).modelViewProjectionMatrix * input.cur_position); |
Ben Clayton | d123267 | 2021-05-18 09:24:18 +0000 | [diff] [blame] | 31 | output.vtxFragColor = input.color; |
James Price | a5d73ce | 2021-08-04 22:15:28 +0000 | [diff] [blame] | 32 | return output; |
| 33 | } |
| 34 | |
James Price | e548db9 | 2021-10-28 15:00:39 +0000 | [diff] [blame] | 35 | vertex tint_symbol_2 vtx_main(const constant Uniforms* tint_symbol_8 [[buffer(0)]], tint_symbol_1 tint_symbol [[stage_in]]) { |
James Price | a5d73ce | 2021-08-04 22:15:28 +0000 | [diff] [blame] | 36 | VertexInput const tint_symbol_6 = {.cur_position=tint_symbol.cur_position, .color=tint_symbol.color}; |
James Price | e548db9 | 2021-10-28 15:00:39 +0000 | [diff] [blame] | 37 | VertexOutput const inner_result = vtx_main_inner(tint_symbol_6, tint_symbol_8); |
James Price | a5d73ce | 2021-08-04 22:15:28 +0000 | [diff] [blame] | 38 | tint_symbol_2 wrapper_result = {}; |
| 39 | wrapper_result.vtxFragColor = inner_result.vtxFragColor; |
| 40 | wrapper_result.Position = inner_result.Position; |
| 41 | return wrapper_result; |
| 42 | } |
| 43 | |
Ben Clayton | 8ec32a6 | 2022-02-09 23:55:51 +0000 | [diff] [blame] | 44 | struct tint_symbol_4 { |
| 45 | float4 fragColor [[user(locn0)]]; |
| 46 | }; |
| 47 | |
| 48 | struct tint_symbol_5 { |
| 49 | float4 value [[color(0)]]; |
| 50 | }; |
| 51 | |
James Price | a5d73ce | 2021-08-04 22:15:28 +0000 | [diff] [blame] | 52 | float4 frag_main_inner(float4 fragColor) { |
| 53 | return fragColor; |
Ben Clayton | d123267 | 2021-05-18 09:24:18 +0000 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | fragment tint_symbol_5 frag_main(tint_symbol_4 tint_symbol_3 [[stage_in]]) { |
James Price | a5d73ce | 2021-08-04 22:15:28 +0000 | [diff] [blame] | 57 | float4 const inner_result_1 = frag_main_inner(tint_symbol_3.fragColor); |
| 58 | tint_symbol_5 wrapper_result_1 = {}; |
| 59 | wrapper_result_1.value = inner_result_1; |
| 60 | return wrapper_result_1; |
Ben Clayton | d123267 | 2021-05-18 09:24:18 +0000 | [diff] [blame] | 61 | } |
| 62 | |