blob: aeb617de1541ecf4d86ff9b023c25bc825efb068 [file] [log] [blame]
James Price61de3b82024-06-12 03:02:19 +00001#include <metal_stdlib>
2using namespace metal;
James Price48be7e82024-06-19 22:38:07 +00003
James Price61de3b82024-06-12 03:02:19 +00004struct tint_module_vars_struct {
James Price61de3b82024-06-12 03:02:19 +00005 device float4* prevent_dce;
James Price812c9d02024-06-29 21:54:00 +00006 texture2d_array<float, access::read> arg_0;
James Price61de3b82024-06-12 03:02:19 +00007};
James Price48be7e82024-06-19 22:38:07 +00008
James Price2cc6b3c2024-06-13 20:31:41 +00009struct VertexOutput {
10 float4 pos;
11 float4 prevent_dce;
12};
James Price48be7e82024-06-19 22:38:07 +000013
James Price61de3b82024-06-12 03:02:19 +000014struct vertex_main_outputs {
James Price2cc6b3c2024-06-13 20:31:41 +000015 float4 VertexOutput_pos [[position]];
16 float4 VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
James Price61de3b82024-06-12 03:02:19 +000017};
James Pricea30f8dd2024-05-10 14:31:43 +000018
James Price2cc6b3c2024-06-13 20:31:41 +000019float4 textureLoad_4951bb(tint_module_vars_struct tint_module_vars) {
James Price61de3b82024-06-12 03:02:19 +000020 float4 res = tint_module_vars.arg_0.read(uint2(1u), 1);
James Price2cc6b3c2024-06-13 20:31:41 +000021 return res;
James Pricea30f8dd2024-05-10 14:31:43 +000022}
James Price48be7e82024-06-19 22:38:07 +000023
James Price812c9d02024-06-29 21:54:00 +000024fragment void fragment_main(device float4* prevent_dce [[buffer(0)]], texture2d_array<float, access::read> arg_0 [[texture(0)]]) {
25 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce, .arg_0=arg_0};
James Price2cc6b3c2024-06-13 20:31:41 +000026 (*tint_module_vars.prevent_dce) = textureLoad_4951bb(tint_module_vars);
James Pricea30f8dd2024-05-10 14:31:43 +000027}
James Price48be7e82024-06-19 22:38:07 +000028
James Price812c9d02024-06-29 21:54:00 +000029kernel void compute_main(device float4* prevent_dce [[buffer(0)]], texture2d_array<float, access::read> arg_0 [[texture(0)]]) {
30 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce, .arg_0=arg_0};
James Price2cc6b3c2024-06-13 20:31:41 +000031 (*tint_module_vars.prevent_dce) = textureLoad_4951bb(tint_module_vars);
James Pricea30f8dd2024-05-10 14:31:43 +000032}
James Price48be7e82024-06-19 22:38:07 +000033
James Price2cc6b3c2024-06-13 20:31:41 +000034VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
35 VertexOutput out = {};
36 out.pos = float4(0.0f);
37 out.prevent_dce = textureLoad_4951bb(tint_module_vars);
38 return out;
39}
James Price48be7e82024-06-19 22:38:07 +000040
James Price2cc6b3c2024-06-13 20:31:41 +000041vertex vertex_main_outputs vertex_main(texture2d_array<float, access::read> arg_0 [[texture(0)]]) {
42 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0};
43 VertexOutput const v = vertex_main_inner(tint_module_vars);
James Price6d87fa62024-09-03 23:24:13 +000044 vertex_main_outputs tint_wrapper_result = {};
45 tint_wrapper_result.VertexOutput_pos = v.pos;
46 tint_wrapper_result.VertexOutput_prevent_dce = v.prevent_dce;
47 return tint_wrapper_result;
James Pricea30f8dd2024-05-10 14:31:43 +000048}