blob: 05f73161845fc947005827672f95115a3e1c1ee1 [file] [log] [blame]
James Pricefabad502024-06-18 15:23:55 +00001#include <metal_stdlib>
2using namespace metal;
James Price48be7e82024-06-19 22:38:07 +00003
James Pricefabad502024-06-18 15:23:55 +00004struct tint_module_vars_struct {
5 depth2d<float, access::sample> arg_0;
6 sampler arg_1;
7 device float* prevent_dce;
8};
James Price48be7e82024-06-19 22:38:07 +00009
James Pricefabad502024-06-18 15:23:55 +000010struct VertexOutput {
11 float4 pos;
12 float prevent_dce;
13};
James Price48be7e82024-06-19 22:38:07 +000014
James Pricefabad502024-06-18 15:23:55 +000015struct vertex_main_outputs {
16 float4 VertexOutput_pos [[position]];
17 float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
18};
dan sinclairf1f381a2023-11-22 09:44:15 +000019
James Pricefabad502024-06-18 15:23:55 +000020float textureSampleCompareLevel_2ad2b1(tint_module_vars_struct tint_module_vars) {
21 float2 arg_2 = float2(1.0f);
22 float arg_3 = 1.0f;
23 float2 const v = arg_2;
24 float const v_1 = arg_3;
25 float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, v, v_1, level(0u));
26 return res;
dan sinclairf1f381a2023-11-22 09:44:15 +000027}
James Price48be7e82024-06-19 22:38:07 +000028
James Pricefabad502024-06-18 15:23:55 +000029fragment void fragment_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
30 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
31 (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_2ad2b1(tint_module_vars);
dan sinclairf1f381a2023-11-22 09:44:15 +000032}
James Price48be7e82024-06-19 22:38:07 +000033
James Pricefabad502024-06-18 15:23:55 +000034kernel void compute_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
35 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
36 (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_2ad2b1(tint_module_vars);
dan sinclairf1f381a2023-11-22 09:44:15 +000037}
James Price48be7e82024-06-19 22:38:07 +000038
James Pricefabad502024-06-18 15:23:55 +000039VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
40 VertexOutput out = {};
41 out.pos = float4(0.0f);
42 out.prevent_dce = textureSampleCompareLevel_2ad2b1(tint_module_vars);
43 return out;
dan sinclairf1f381a2023-11-22 09:44:15 +000044}
James Price48be7e82024-06-19 22:38:07 +000045
James Pricefabad502024-06-18 15:23:55 +000046vertex vertex_main_outputs vertex_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
47 tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
48 VertexOutput const v_2 = vertex_main_inner(tint_module_vars);
49 return vertex_main_outputs{.VertexOutput_pos=v_2.pos, .VertexOutput_prevent_dce=v_2.prevent_dce};
dan sinclairf1f381a2023-11-22 09:44:15 +000050}