James Price | 456cf28 | 2024-06-11 18:24:06 +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 | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame] | 4 | struct tint_module_vars_struct { |
James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame] | 5 | device uint2* prevent_dce; |
James Price | 812c9d0 | 2024-06-29 21:54:00 +0000 | [diff] [blame] | 6 | texture2d<int, access::write> arg_0; |
James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame] | 7 | }; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 8 | |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 9 | uint2 textureDimensions_cad3b7(tint_module_vars_struct tint_module_vars) { |
James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame] | 10 | uint const v = tint_module_vars.arg_0.get_width(0u); |
| 11 | uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u)); |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 12 | return res; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 13 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 14 | |
James Price | 812c9d0 | 2024-06-29 21:54:00 +0000 | [diff] [blame] | 15 | fragment void fragment_main(device uint2* prevent_dce [[buffer(0)]], texture2d<int, access::write> arg_0 [[texture(0)]]) { |
| 16 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce, .arg_0=arg_0}; |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 17 | (*tint_module_vars.prevent_dce) = textureDimensions_cad3b7(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 18 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 19 | |
James Price | 812c9d0 | 2024-06-29 21:54:00 +0000 | [diff] [blame] | 20 | kernel void compute_main(device uint2* prevent_dce [[buffer(0)]], texture2d<int, access::write> arg_0 [[texture(0)]]) { |
| 21 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce, .arg_0=arg_0}; |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 22 | (*tint_module_vars.prevent_dce) = textureDimensions_cad3b7(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 23 | } |