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 float4* prevent_dce; |
| 5 | }; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 6 | |
James Price | 085093d | 2024-06-06 02:09:47 +0000 | [diff] [blame] | 7 | void fwidth_d2ab9a(tint_module_vars_struct tint_module_vars) { |
| 8 | float4 res = fwidth(float4(1.0f)); |
| 9 | (*tint_module_vars.prevent_dce) = res; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 10 | } |
James Price | 085093d | 2024-06-06 02:09:47 +0000 | [diff] [blame] | 11 | fragment void fragment_main(device float4* prevent_dce [[buffer(0)]]) { |
| 12 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce}; |
| 13 | fwidth_d2ab9a(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 14 | } |