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 | depthcube<float, access::sample> arg_0; |
| 5 | device uint2* prevent_dce; |
| 6 | }; |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 7 | struct VertexOutput { |
| 8 | float4 pos; |
| 9 | uint2 prevent_dce; |
| 10 | }; |
James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame] | 11 | struct vertex_main_outputs { |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 12 | float4 VertexOutput_pos [[position]]; |
| 13 | uint2 VertexOutput_prevent_dce [[user(locn0)]] [[flat]]; |
James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame] | 14 | }; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 15 | |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 16 | uint2 textureDimensions_c5a36e(tint_module_vars_struct tint_module_vars) { |
James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame] | 17 | uint const v = tint_module_vars.arg_0.get_width(0u); |
| 18 | uint2 res = uint2(v, tint_module_vars.arg_0.get_height(0u)); |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 19 | return res; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 20 | } |
James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame] | 21 | fragment void fragment_main(depthcube<float, access::sample> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) { |
| 22 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce}; |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 23 | (*tint_module_vars.prevent_dce) = textureDimensions_c5a36e(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 24 | } |
James Price | 456cf28 | 2024-06-11 18:24:06 +0000 | [diff] [blame] | 25 | kernel void compute_main(depthcube<float, access::sample> arg_0 [[texture(0)]], device uint2* prevent_dce [[buffer(0)]]) { |
| 26 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce}; |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 27 | (*tint_module_vars.prevent_dce) = textureDimensions_c5a36e(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 28 | } |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 29 | VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) { |
| 30 | VertexOutput out = {}; |
| 31 | out.pos = float4(0.0f); |
| 32 | out.prevent_dce = textureDimensions_c5a36e(tint_module_vars); |
| 33 | return out; |
| 34 | } |
| 35 | vertex vertex_main_outputs vertex_main(depthcube<float, access::sample> arg_0 [[texture(0)]]) { |
| 36 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0}; |
| 37 | VertexOutput const v_1 = vertex_main_inner(tint_module_vars); |
| 38 | return vertex_main_outputs{.VertexOutput_pos=v_1.pos, .VertexOutput_prevent_dce=v_1.prevent_dce}; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 39 | } |