James Price | fabad50 | 2024-06-18 15:23:55 +0000 | [diff] [blame] | 1 | #include <metal_stdlib> |
| 2 | using namespace metal; |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 3 | |
James Price | fabad50 | 2024-06-18 15:23:55 +0000 | [diff] [blame] | 4 | struct tint_module_vars_struct { |
| 5 | depth2d<float, access::sample> arg_0; |
| 6 | sampler arg_1; |
| 7 | device float* prevent_dce; |
| 8 | }; |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 9 | |
James Price | fabad50 | 2024-06-18 15:23:55 +0000 | [diff] [blame] | 10 | struct VertexOutput { |
| 11 | float4 pos; |
| 12 | float prevent_dce; |
| 13 | }; |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 14 | |
James Price | fabad50 | 2024-06-18 15:23:55 +0000 | [diff] [blame] | 15 | struct vertex_main_outputs { |
| 16 | float4 VertexOutput_pos [[position]]; |
| 17 | float VertexOutput_prevent_dce [[user(locn0)]] [[flat]]; |
| 18 | }; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 19 | |
James Price | fabad50 | 2024-06-18 15:23:55 +0000 | [diff] [blame] | 20 | float 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 sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 27 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 28 | |
James Price | fabad50 | 2024-06-18 15:23:55 +0000 | [diff] [blame] | 29 | fragment 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 sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 32 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 33 | |
James Price | fabad50 | 2024-06-18 15:23:55 +0000 | [diff] [blame] | 34 | kernel 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 sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 37 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 38 | |
James Price | fabad50 | 2024-06-18 15:23:55 +0000 | [diff] [blame] | 39 | VertexOutput 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 sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 44 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 45 | |
James Price | fabad50 | 2024-06-18 15:23:55 +0000 | [diff] [blame] | 46 | vertex 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 sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 50 | } |