James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 1 | #include <metal_stdlib> |
| 2 | using namespace metal; |
| 3 | struct tint_module_vars_struct { |
| 4 | texture1d<int, access::read> arg_0; |
| 5 | device int4* prevent_dce; |
| 6 | }; |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 7 | struct VertexOutput { |
| 8 | float4 pos; |
| 9 | int4 prevent_dce; |
| 10 | }; |
James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 11 | struct vertex_main_outputs { |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 12 | float4 VertexOutput_pos [[position]]; |
| 13 | int4 VertexOutput_prevent_dce [[user(locn0)]] [[flat]]; |
James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 14 | }; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 15 | |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 16 | int4 textureLoad_33d3aa(tint_module_vars_struct tint_module_vars) { |
James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 17 | int4 res = tint_module_vars.arg_0.read(1u); |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 18 | return res; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 19 | } |
James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 20 | fragment void fragment_main(texture1d<int, access::read> arg_0 [[texture(0)]], device int4* prevent_dce [[buffer(0)]]) { |
| 21 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce}; |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 22 | (*tint_module_vars.prevent_dce) = textureLoad_33d3aa(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 23 | } |
James Price | 61de3b8 | 2024-06-12 03:02:19 +0000 | [diff] [blame] | 24 | kernel void compute_main(texture1d<int, access::read> arg_0 [[texture(0)]], device int4* prevent_dce [[buffer(0)]]) { |
| 25 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .prevent_dce=prevent_dce}; |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 26 | (*tint_module_vars.prevent_dce) = textureLoad_33d3aa(tint_module_vars); |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 27 | } |
James Price | 2cc6b3c | 2024-06-13 20:31:41 +0000 | [diff] [blame] | 28 | VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) { |
| 29 | VertexOutput out = {}; |
| 30 | out.pos = float4(0.0f); |
| 31 | out.prevent_dce = textureLoad_33d3aa(tint_module_vars); |
| 32 | return out; |
| 33 | } |
| 34 | vertex vertex_main_outputs vertex_main(texture1d<int, access::read> arg_0 [[texture(0)]]) { |
| 35 | tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0}; |
| 36 | VertexOutput const v = vertex_main_inner(tint_module_vars); |
| 37 | return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce}; |
dan sinclair | f1f381a | 2023-11-22 09:44:15 +0000 | [diff] [blame] | 38 | } |