James Price | 085093d | 2024-06-06 02:09:47 +0000 | [diff] [blame] | 1 | #include <metal_stdlib> |
| 2 | using namespace metal; |
| 3 | struct tint_module_vars_struct { |
| 4 | device float2* prevent_dce; |
| 5 | }; |
| 6 | struct vertex_main_outputs { |
| 7 | float4 tint_symbol [[position]]; |
| 8 | }; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 9 | |
James Price | 085093d | 2024-06-06 02:09:47 +0000 | [diff] [blame] | 10 | void acos_dfc915(tint_module_vars_struct tint_module_vars) { |
| 11 | float2 res = float2(0.25f); |
| 12 | (*tint_module_vars.prevent_dce) = res; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 13 | } |
James Price | 085093d | 2024-06-06 02:09:47 +0000 | [diff] [blame] | 14 | float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) { |
| 15 | acos_dfc915(tint_module_vars); |
| 16 | return float4(0.0f); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 17 | } |
James Price | 085093d | 2024-06-06 02:09:47 +0000 | [diff] [blame] | 18 | fragment void fragment_main(device float2* prevent_dce [[buffer(0)]]) { |
| 19 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce}; |
| 20 | acos_dfc915(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 21 | } |
James Price | 085093d | 2024-06-06 02:09:47 +0000 | [diff] [blame] | 22 | kernel void compute_main(device float2* prevent_dce [[buffer(0)]]) { |
| 23 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce}; |
| 24 | acos_dfc915(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 25 | } |
James Price | 085093d | 2024-06-06 02:09:47 +0000 | [diff] [blame] | 26 | vertex vertex_main_outputs vertex_main(device float2* prevent_dce [[buffer(0)]]) { |
| 27 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce}; |
| 28 | return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)}; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 29 | } |