blob: 673045a26d749284477f186e2b6d5713cc738348 [file] [log] [blame]
James Price2a08d5b22024-06-13 05:04:52 +00001#include <metal_stdlib>
2using namespace metal;
3struct tint_module_vars_struct {
4 texture3d<float, access::sample> arg_0;
5 sampler arg_1;
6 device float4* prevent_dce;
7};
James Price2cc6b3c2024-06-13 20:31:41 +00008struct VertexOutput {
9 float4 pos;
10 float4 prevent_dce;
11};
James Price2a08d5b22024-06-13 05:04:52 +000012struct vertex_main_outputs {
James Price2cc6b3c2024-06-13 20:31:41 +000013 float4 VertexOutput_pos [[position]];
14 float4 VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
James Price2a08d5b22024-06-13 05:04:52 +000015};
dan sinclairf1f381a2023-11-22 09:44:15 +000016
James Price2cc6b3c2024-06-13 20:31:41 +000017float4 textureSampleLevel_dcbecb(tint_module_vars_struct tint_module_vars) {
James Price2a08d5b22024-06-13 05:04:52 +000018 float3 arg_2 = float3(1.0f);
19 float arg_3 = 1.0f;
20 float3 const v = arg_2;
21 float4 res = tint_module_vars.arg_0.sample(tint_module_vars.arg_1, v, level(arg_3), int3(1));
James Price2cc6b3c2024-06-13 20:31:41 +000022 return res;
dan sinclairf1f381a2023-11-22 09:44:15 +000023}
James Price2a08d5b22024-06-13 05:04:52 +000024fragment void fragment_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
25 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
James Price2cc6b3c2024-06-13 20:31:41 +000026 (*tint_module_vars.prevent_dce) = textureSampleLevel_dcbecb(tint_module_vars);
dan sinclairf1f381a2023-11-22 09:44:15 +000027}
James Price2a08d5b22024-06-13 05:04:52 +000028kernel void compute_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float4* prevent_dce [[buffer(0)]]) {
29 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
James Price2cc6b3c2024-06-13 20:31:41 +000030 (*tint_module_vars.prevent_dce) = textureSampleLevel_dcbecb(tint_module_vars);
dan sinclairf1f381a2023-11-22 09:44:15 +000031}
James Price2cc6b3c2024-06-13 20:31:41 +000032VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
33 VertexOutput out = {};
34 out.pos = float4(0.0f);
35 out.prevent_dce = textureSampleLevel_dcbecb(tint_module_vars);
36 return out;
37}
38vertex vertex_main_outputs vertex_main(texture3d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
39 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
40 VertexOutput const v_1 = vertex_main_inner(tint_module_vars);
41 return vertex_main_outputs{.VertexOutput_pos=v_1.pos, .VertexOutput_prevent_dce=v_1.prevent_dce};
dan sinclairf1f381a2023-11-22 09:44:15 +000042}