James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 1 | #include <metal_stdlib> |
| 2 | using namespace metal; |
| 3 | struct tint_module_vars_struct { |
| 4 | texture2d_array<float, access::read> arg_0; |
| 5 | device float4* prevent_dce; |
| 6 | }; |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 7 | struct VertexOutput { |
| 8 | float4 pos; |
| 9 | float4 prevent_dce; |
| 10 | }; |
James Price | 61de3b8 | 2024-06-12 03:02:19 +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 | float4 VertexOutput_prevent_dce [[user(locn0)]] [[flat]]; |
James Price | 61de3b8 | 2024-06-12 03:02:19 +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 | float4 textureLoad_ac64f7(tint_module_vars_struct tint_module_vars) { |
James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 17 | uint2 arg_1 = uint2(1u); |
| 18 | uint arg_2 = 1u; |
| 19 | float4 res = tint_module_vars.arg_0.read(arg_1, arg_2); |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 20 | return res; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 21 | } |
James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 22 | fragment void fragment_main(texture2d_array<float, access::read> arg_0 [[texture(0)]], device float4* prevent_dce [[buffer(0)]]) { |
| 23 | 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^] | 24 | (*tint_module_vars.prevent_dce) = textureLoad_ac64f7(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 25 | } |
James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 26 | kernel void compute_main(texture2d_array<float, access::read> arg_0 [[texture(0)]], device float4* prevent_dce [[buffer(0)]]) { |
| 27 | 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^] | 28 | (*tint_module_vars.prevent_dce) = textureLoad_ac64f7(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 29 | } |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 30 | VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) { |
| 31 | VertexOutput out = {}; |
| 32 | out.pos = float4(0.0f); |
| 33 | out.prevent_dce = textureLoad_ac64f7(tint_module_vars); |
| 34 | return out; |
| 35 | } |
| 36 | vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read> arg_0 [[texture(0)]]) { |
| 37 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0}; |
| 38 | VertexOutput const v = vertex_main_inner(tint_module_vars); |
| 39 | return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce}; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 40 | } |