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 | |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 4 | struct VertexOutput { |
| 5 | float4 pos; |
| 6 | }; |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 7 | |
James Price | 02cf911 | 2024-05-29 14:43:19 +0000 | [diff] [blame] | 8 | struct vertex_main_outputs { |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 9 | float4 VertexOutput_pos [[position]]; |
James Price | 02cf911 | 2024-05-29 14:43:19 +0000 | [diff] [blame] | 10 | }; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 11 | |
dan sinclair | b4697b76 | 2023-11-24 09:42:19 +0000 | [diff] [blame] | 12 | void clamp_9d731c() { |
| 13 | float2 res = float2(1.0f); |
| 14 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 15 | |
dan sinclair | b4697b76 | 2023-11-24 09:42:19 +0000 | [diff] [blame] | 16 | fragment void fragment_main() { |
| 17 | clamp_9d731c(); |
| 18 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 19 | |
dan sinclair | b4697b76 | 2023-11-24 09:42:19 +0000 | [diff] [blame] | 20 | kernel void compute_main() { |
| 21 | clamp_9d731c(); |
| 22 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 23 | |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 24 | VertexOutput vertex_main_inner() { |
| 25 | VertexOutput out = {}; |
| 26 | out.pos = float4(0.0f); |
| 27 | clamp_9d731c(); |
| 28 | return out; |
| 29 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 30 | |
James Price | 02cf911 | 2024-05-29 14:43:19 +0000 | [diff] [blame] | 31 | vertex vertex_main_outputs vertex_main() { |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 32 | return vertex_main_outputs{.VertexOutput_pos=vertex_main_inner().pos}; |
James Price | 02cf911 | 2024-05-29 14:43:19 +0000 | [diff] [blame] | 33 | } |