James Price | 61de3b8 | 2024-06-12 03:02:19 +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 | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 4 | struct tint_module_vars_struct { |
James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 5 | device int4* prevent_dce; |
James Price | 812c9d0 | 2024-06-29 21:54:00 +0000 | [diff] [blame] | 6 | texture3d<int, access::sample> arg_0; |
James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 7 | }; |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 8 | |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 9 | struct VertexOutput { |
| 10 | float4 pos; |
| 11 | int4 prevent_dce; |
| 12 | }; |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 13 | |
James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 14 | struct vertex_main_outputs { |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 15 | float4 VertexOutput_pos [[position]]; |
| 16 | int4 VertexOutput_prevent_dce [[user(locn0)]] [[flat]]; |
James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 17 | }; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 18 | |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 19 | int4 textureLoad_223246(tint_module_vars_struct tint_module_vars) { |
James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 20 | int4 res = tint_module_vars.arg_0.read(uint3(1u), 1); |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 21 | return res; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 22 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 23 | |
James Price | 812c9d0 | 2024-06-29 21:54:00 +0000 | [diff] [blame] | 24 | fragment void fragment_main(device int4* prevent_dce [[buffer(0)]], texture3d<int, access::sample> arg_0 [[texture(0)]]) { |
| 25 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce, .arg_0=arg_0}; |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 26 | (*tint_module_vars.prevent_dce) = textureLoad_223246(tint_module_vars); |
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 | 812c9d0 | 2024-06-29 21:54:00 +0000 | [diff] [blame] | 29 | kernel void compute_main(device int4* prevent_dce [[buffer(0)]], texture3d<int, access::sample> arg_0 [[texture(0)]]) { |
| 30 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.prevent_dce=prevent_dce, .arg_0=arg_0}; |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 31 | (*tint_module_vars.prevent_dce) = textureLoad_223246(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 | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 34 | VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) { |
| 35 | VertexOutput out = {}; |
| 36 | out.pos = float4(0.0f); |
| 37 | out.prevent_dce = textureLoad_223246(tint_module_vars); |
| 38 | return out; |
| 39 | } |
James Price | 48be7e8 | 2024-06-19 22:38:07 +0000 | [diff] [blame] | 40 | |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 41 | vertex vertex_main_outputs vertex_main(texture3d<int, access::sample> arg_0 [[texture(0)]]) { |
| 42 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0}; |
| 43 | VertexOutput const v = vertex_main_inner(tint_module_vars); |
James Price | 6d87fa6 | 2024-09-03 23:24:13 +0000 | [diff] [blame] | 44 | vertex_main_outputs tint_wrapper_result = {}; |
| 45 | tint_wrapper_result.VertexOutput_pos = v.pos; |
| 46 | tint_wrapper_result.VertexOutput_prevent_dce = v.prevent_dce; |
| 47 | return tint_wrapper_result; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 48 | } |