dan sinclair | b4697b76 | 2023-11-24 09:42:19 +0000 | [diff] [blame] | 1 | #include <metal_stdlib> |
| 2 | using namespace metal; |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 3 | |
dan sinclair | b4697b76 | 2023-11-24 09:42:19 +0000 | [diff] [blame] | 4 | struct modf_result_vec3_f32 { |
| 5 | float3 fract; |
| 6 | float3 whole; |
| 7 | }; |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 8 | |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 9 | struct VertexOutput { |
| 10 | float4 pos; |
| 11 | }; |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 12 | |
James Price | 02cf911 | 2024-05-29 14:43:19 +0000 | [diff] [blame] | 13 | struct vertex_main_outputs { |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 14 | float4 VertexOutput_pos [[position]]; |
James Price | 02cf911 | 2024-05-29 14:43:19 +0000 | [diff] [blame] | 15 | }; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 16 | |
dan sinclair | b4697b76 | 2023-11-24 09:42:19 +0000 | [diff] [blame] | 17 | void modf_68d8ee() { |
| 18 | modf_result_vec3_f32 res = modf_result_vec3_f32{.fract=float3(-0.5f), .whole=float3(-1.0f)}; |
| 19 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 20 | |
dan sinclair | b4697b76 | 2023-11-24 09:42:19 +0000 | [diff] [blame] | 21 | fragment void fragment_main() { |
| 22 | modf_68d8ee(); |
| 23 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 24 | |
dan sinclair | b4697b76 | 2023-11-24 09:42:19 +0000 | [diff] [blame] | 25 | kernel void compute_main() { |
| 26 | modf_68d8ee(); |
| 27 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 28 | |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 29 | VertexOutput vertex_main_inner() { |
| 30 | VertexOutput out = {}; |
| 31 | out.pos = float4(0.0f); |
| 32 | modf_68d8ee(); |
| 33 | return out; |
| 34 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 35 | |
James Price | 02cf911 | 2024-05-29 14:43:19 +0000 | [diff] [blame] | 36 | vertex vertex_main_outputs vertex_main() { |
James Price | 6d87fa6 | 2024-09-03 23:24:13 +0000 | [diff] [blame] | 37 | vertex_main_outputs tint_wrapper_result = {}; |
| 38 | tint_wrapper_result.VertexOutput_pos = vertex_main_inner().pos; |
| 39 | return tint_wrapper_result; |
James Price | 02cf911 | 2024-05-29 14:43:19 +0000 | [diff] [blame] | 40 | } |