Ben Clayton | 2e376a9 | 2022-10-26 18:47:02 +0000 | [diff] [blame] | 1 | #include <metal_stdlib> |
| 2 | |
| 3 | using namespace metal; |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 4 | float4 textureGather_831549(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) { |
Peter McNeeley | 4469c71 | 2024-08-15 15:35:44 +0000 | [diff] [blame^] | 5 | float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), max(0, 1), int2(1), component::y); |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 6 | return res; |
Ben Clayton | 2e376a9 | 2022-10-26 18:47:02 +0000 | [diff] [blame] | 7 | } |
| 8 | |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 9 | fragment void fragment_main(device float4* tint_symbol_3 [[buffer(0)]], texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]], sampler tint_symbol_5 [[sampler(0)]]) { |
| 10 | *(tint_symbol_3) = textureGather_831549(tint_symbol_4, tint_symbol_5); |
| 11 | return; |
| 12 | } |
| 13 | |
| 14 | kernel void compute_main(device float4* tint_symbol_6 [[buffer(0)]], texture2d_array<float, access::sample> tint_symbol_7 [[texture(0)]], sampler tint_symbol_8 [[sampler(0)]]) { |
| 15 | *(tint_symbol_6) = textureGather_831549(tint_symbol_7, tint_symbol_8); |
| 16 | return; |
| 17 | } |
| 18 | |
| 19 | struct VertexOutput { |
| 20 | float4 pos; |
| 21 | float4 prevent_dce; |
Ben Clayton | 2e376a9 | 2022-10-26 18:47:02 +0000 | [diff] [blame] | 22 | }; |
| 23 | |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 24 | struct tint_symbol { |
| 25 | float4 prevent_dce [[user(locn0)]] [[flat]]; |
| 26 | float4 pos [[position]]; |
| 27 | }; |
| 28 | |
| 29 | VertexOutput vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_9, sampler tint_symbol_10) { |
| 30 | VertexOutput out = {}; |
| 31 | out.pos = float4(0.0f); |
| 32 | out.prevent_dce = textureGather_831549(tint_symbol_9, tint_symbol_10); |
| 33 | return out; |
Ben Clayton | 2e376a9 | 2022-10-26 18:47:02 +0000 | [diff] [blame] | 34 | } |
| 35 | |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 36 | vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_11 [[texture(0)]], sampler tint_symbol_12 [[sampler(0)]]) { |
| 37 | VertexOutput const inner_result = vertex_main_inner(tint_symbol_11, tint_symbol_12); |
Ben Clayton | 2e376a9 | 2022-10-26 18:47:02 +0000 | [diff] [blame] | 38 | tint_symbol wrapper_result = {}; |
Natalie Chouinard | e902718 | 2024-06-13 18:50:19 +0000 | [diff] [blame] | 39 | wrapper_result.pos = inner_result.pos; |
| 40 | wrapper_result.prevent_dce = inner_result.prevent_dce; |
Ben Clayton | 2e376a9 | 2022-10-26 18:47:02 +0000 | [diff] [blame] | 41 | return wrapper_result; |
| 42 | } |
| 43 | |