James Price | 2a08d5b2 | 2024-06-13 05:04:52 +0000 | [diff] [blame] | 1 | #include <metal_stdlib> |
| 2 | using namespace metal; |
| 3 | struct tint_module_vars_struct { |
| 4 | texture3d<float, access::sample> arg_0; |
| 5 | sampler arg_1; |
| 6 | device float4* prevent_dce; |
| 7 | }; |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 8 | struct VertexOutput { |
| 9 | float4 pos; |
| 10 | float4 prevent_dce; |
| 11 | }; |
James Price | 2a08d5b2 | 2024-06-13 05:04:52 +0000 | [diff] [blame] | 12 | struct vertex_main_outputs { |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 13 | float4 VertexOutput_pos [[position]]; |
| 14 | float4 VertexOutput_prevent_dce [[user(locn0)]] [[flat]]; |
James Price | 2a08d5b2 | 2024-06-13 05:04:52 +0000 | [diff] [blame] | 15 | }; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 16 | |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 17 | float4 textureSampleLevel_dcbecb(tint_module_vars_struct tint_module_vars) { |
James Price | 2a08d5b2 | 2024-06-13 05:04:52 +0000 | [diff] [blame] | 18 | 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 Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 22 | return res; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 23 | } |
James Price | 2a08d5b2 | 2024-06-13 05:04:52 +0000 | [diff] [blame] | 24 | fragment 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 Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 26 | (*tint_module_vars.prevent_dce) = textureSampleLevel_dcbecb(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 27 | } |
James Price | 2a08d5b2 | 2024-06-13 05:04:52 +0000 | [diff] [blame] | 28 | kernel 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 Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 30 | (*tint_module_vars.prevent_dce) = textureSampleLevel_dcbecb(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 31 | } |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame^] | 32 | VertexOutput 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 | } |
| 38 | vertex 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 sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 42 | } |