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 int* 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 any_0e3e58(tint_module_vars_struct tint_module_vars) { |
| 11 | bool2 arg_0 = bool2(true); |
| 12 | bool res = any(arg_0); |
| 13 | (*tint_module_vars.prevent_dce) = select(0, 1, all(!(res))); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 14 | } |
James Price | 085093d | 2024-06-06 02:09:47 +0000 | [diff] [blame] | 15 | float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) { |
| 16 | any_0e3e58(tint_module_vars); |
| 17 | return float4(0.0f); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 18 | } |
James Price | 085093d | 2024-06-06 02:09:47 +0000 | [diff] [blame] | 19 | fragment void fragment_main(device int* prevent_dce [[buffer(0)]]) { |
| 20 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce}; |
| 21 | any_0e3e58(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 22 | } |
James Price | 085093d | 2024-06-06 02:09:47 +0000 | [diff] [blame] | 23 | kernel void compute_main(device int* prevent_dce [[buffer(0)]]) { |
| 24 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce}; |
| 25 | any_0e3e58(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 26 | } |
James Price | 085093d | 2024-06-06 02:09:47 +0000 | [diff] [blame] | 27 | vertex vertex_main_outputs vertex_main(device int* prevent_dce [[buffer(0)]]) { |
| 28 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce}; |
| 29 | return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)}; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 30 | } |