James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame^] | 1 | #include <metal_stdlib> |
| 2 | using namespace metal; |
| 3 | struct tint_module_vars_struct { |
| 4 | texture2d_array<float, access::write> arg_0; |
| 5 | device uint2* prevent_dce; |
| 6 | }; |
| 7 | struct vertex_main_outputs { |
| 8 | float4 tint_symbol [[position]]; |
| 9 | }; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 10 | |
James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame^] | 11 | void textureDimensions_867ead(tint_module_vars_struct tint_module_vars) { |
| 12 | uint const v = tint_module_vars.arg_0.get_width(0u); |
| 13 | uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u)); |
| 14 | (*tint_module_vars.prevent_dce) = res; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 15 | } |
James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame^] | 16 | float4 vertex_main_inner(tint_module_vars_struct tint_module_vars) { |
| 17 | textureDimensions_867ead(tint_module_vars); |
| 18 | return float4(0.0f); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 19 | } |
James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame^] | 20 | fragment void fragment_main(texture2d_array<float, access::write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) { |
| 21 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce}; |
| 22 | textureDimensions_867ead(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 23 | } |
James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame^] | 24 | kernel void compute_main(texture2d_array<float, access::write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) { |
| 25 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce}; |
| 26 | textureDimensions_867ead(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 27 | } |
James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame^] | 28 | vertex vertex_main_outputs vertex_main(texture2d_array<float, access::write> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) { |
| 29 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce}; |
| 30 | return vertex_main_outputs{.tint_symbol=vertex_main_inner(tint_module_vars)}; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 31 | } |