blob: 562d4e40eeaa520338f47a43342e4a01eac4421c [file] [log] [blame]
James Price3efa5b12024-06-18 15:23:55 +00001#include <metal_stdlib>
2using namespace metal;
James Price48be7e82024-06-19 22:38:07 +00003
James Price3efa5b12024-06-18 15:23:55 +00004struct tint_module_vars_struct {
James Price812c9d02024-06-29 21:54:00 +00005 device float4* prevent_dce;
James Price3efa5b12024-06-18 15:23:55 +00006 texture2d_array<float, access::sample> arg_1;
7 sampler arg_2;
James Price3efa5b12024-06-18 15:23:55 +00008};
James Price48be7e82024-06-19 22:38:07 +00009
James Price3efa5b12024-06-18 15:23:55 +000010struct VertexOutput {
11 float4 pos;
12 float4 prevent_dce;
13};
James Price48be7e82024-06-19 22:38:07 +000014
James Price3efa5b12024-06-18 15:23:55 +000015struct vertex_main_outputs {
16 float4 VertexOutput_pos [[position]];
17 float4 VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
18};
dan sinclairf1f381a2023-11-22 09:44:15 +000019
James Price3efa5b12024-06-18 15:23:55 +000020float4 textureGather_831549(tint_module_vars_struct tint_module_vars) {
21 float2 arg_3 = float2(1.0f);
22 int arg_4 = 1;
Peter McNeeley4469c712024-08-15 15:35:44 +000023 float2 const v = arg_3;
24 float4 res = tint_module_vars.arg_1.gather(tint_module_vars.arg_2, v, max(arg_4, 0), int2(1), component::y);
James Price3efa5b12024-06-18 15:23:55 +000025 return res;
dan sinclairf1f381a2023-11-22 09:44:15 +000026}
James Price48be7e82024-06-19 22:38:07 +000027
James Price812c9d02024-06-29 21:54:00 +000028fragment void fragment_main(device float4* prevent_dce [[buffer(0)]], texture2d_array<float, access::sample> arg_1 [[texture(0)]], sampler arg_2 [[sampler(0)]]) {
29 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce, .arg_1=arg_1, .arg_2=arg_2};
James Price3efa5b12024-06-18 15:23:55 +000030 (*tint_module_vars.prevent_dce) = textureGather_831549(tint_module_vars);
dan sinclairf1f381a2023-11-22 09:44:15 +000031}
James Price48be7e82024-06-19 22:38:07 +000032
James Price812c9d02024-06-29 21:54:00 +000033kernel void compute_main(device float4* prevent_dce [[buffer(0)]], texture2d_array<float, access::sample> arg_1 [[texture(0)]], sampler arg_2 [[sampler(0)]]) {
34 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce, .arg_1=arg_1, .arg_2=arg_2};
James Price3efa5b12024-06-18 15:23:55 +000035 (*tint_module_vars.prevent_dce) = textureGather_831549(tint_module_vars);
dan sinclairf1f381a2023-11-22 09:44:15 +000036}
James Price48be7e82024-06-19 22:38:07 +000037
James Price3efa5b12024-06-18 15:23:55 +000038VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
39 VertexOutput out = {};
40 out.pos = float4(0.0f);
41 out.prevent_dce = textureGather_831549(tint_module_vars);
42 return out;
dan sinclairf1f381a2023-11-22 09:44:15 +000043}
James Price48be7e82024-06-19 22:38:07 +000044
James Price3efa5b12024-06-18 15:23:55 +000045vertex vertex_main_outputs vertex_main(texture2d_array<float, access::sample> arg_1 [[texture(0)]], sampler arg_2 [[sampler(0)]]) {
46 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_1=arg_1, .arg_2=arg_2};
Peter McNeeley4469c712024-08-15 15:35:44 +000047 VertexOutput const v_1 = vertex_main_inner(tint_module_vars);
James Price6d87fa62024-09-03 23:24:13 +000048 vertex_main_outputs tint_wrapper_result = {};
49 tint_wrapper_result.VertexOutput_pos = v_1.pos;
50 tint_wrapper_result.VertexOutput_prevent_dce = v_1.prevent_dce;
51 return tint_wrapper_result;
dan sinclairf1f381a2023-11-22 09:44:15 +000052}