blob: 69e067372376729fbe113b471b09d44551a32aa0 [file] [log] [blame]
Ben Clayton2e376a92022-10-26 18:47:02 +00001#include <metal_stdlib>
2
3using namespace metal;
Natalie Chouinarde9027182024-06-13 18:50:19 +00004float4 textureGather_831549(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
Peter McNeeley4469c712024-08-15 15:35:44 +00005 float4 res = tint_symbol_1.gather(tint_symbol_2, float2(1.0f), max(0, 1), int2(1), component::y);
Natalie Chouinarde9027182024-06-13 18:50:19 +00006 return res;
Ben Clayton2e376a92022-10-26 18:47:02 +00007}
8
Natalie Chouinarde9027182024-06-13 18:50:19 +00009fragment 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
14kernel 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
19struct VertexOutput {
20 float4 pos;
21 float4 prevent_dce;
Ben Clayton2e376a92022-10-26 18:47:02 +000022};
23
Natalie Chouinarde9027182024-06-13 18:50:19 +000024struct tint_symbol {
25 float4 prevent_dce [[user(locn0)]] [[flat]];
26 float4 pos [[position]];
27};
28
29VertexOutput 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 Clayton2e376a92022-10-26 18:47:02 +000034}
35
Natalie Chouinarde9027182024-06-13 18:50:19 +000036vertex 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 Clayton2e376a92022-10-26 18:47:02 +000038 tint_symbol wrapper_result = {};
Natalie Chouinarde9027182024-06-13 18:50:19 +000039 wrapper_result.pos = inner_result.pos;
40 wrapper_result.prevent_dce = inner_result.prevent_dce;
Ben Clayton2e376a92022-10-26 18:47:02 +000041 return wrapper_result;
42}
43