blob: e57ddcb7e9bda11396b96bcabda3ec59ef62f1ea [file] [log] [blame]
James Price0368d972024-06-13 17:05:19 +00001#include <metal_stdlib>
2using namespace metal;
James Price48be7e82024-06-19 22:38:07 +00003
James Price0368d972024-06-13 17:05:19 +00004struct tint_module_vars_struct {
James Price0368d972024-06-13 17:05:19 +00005 device uint* prevent_dce;
James Price812c9d02024-06-29 21:54:00 +00006 texture2d_array<float, access::read_write> arg_0;
James Price0368d972024-06-13 17:05:19 +00007};
dan sinclairf1f381a2023-11-22 09:44:15 +00008
James Price2cc6b3c2024-06-13 20:31:41 +00009uint textureNumLayers_6da0eb(tint_module_vars_struct tint_module_vars) {
James Price0368d972024-06-13 17:05:19 +000010 uint res = tint_module_vars.arg_0.get_array_size();
James Price2cc6b3c2024-06-13 20:31:41 +000011 return res;
dan sinclairf1f381a2023-11-22 09:44:15 +000012}
James Price48be7e82024-06-19 22:38:07 +000013
James Price812c9d02024-06-29 21:54:00 +000014fragment void fragment_main(device uint* prevent_dce [[buffer(0)]], texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
15 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 +000016 (*tint_module_vars.prevent_dce) = textureNumLayers_6da0eb(tint_module_vars);
dan sinclairf1f381a2023-11-22 09:44:15 +000017}
James Price48be7e82024-06-19 22:38:07 +000018
James Price812c9d02024-06-29 21:54:00 +000019kernel void compute_main(device uint* prevent_dce [[buffer(0)]], texture2d_array<float, access::read_write> arg_0 [[texture(0)]]) {
20 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 +000021 (*tint_module_vars.prevent_dce) = textureNumLayers_6da0eb(tint_module_vars);
dan sinclairf1f381a2023-11-22 09:44:15 +000022}