| #include <metal_stdlib> |
| using namespace metal; |
| typedef float2 __attribute__((__may_alias__)) tint_aliased_vec2_f32; |
| |
| struct tint_immediate_data_struct { |
| /* 0x0000 */ uint tint_non_constant_zero; |
| /* 0x0004 */ array<int8_t, 2044> tint_pad; |
| /* 0x0800 */ array<uint, 1> tint_storage_buffer_sizes; |
| }; |
| |
| struct tint_module_vars_struct { |
| device array<uchar, 1>* v; |
| const constant tint_immediate_data_struct* tint_immediate_data; |
| }; |
| |
| struct tint_array_lengths_struct { |
| uint tint_array_length_0_0; |
| }; |
| |
| void foo(device array<uchar, 1>* const p, uint tint_array_length) { |
| device tint_aliased_vec2_f32* const v_1 = reinterpret_cast<device float2*>(reinterpret_cast<device char*>(p) + select(0u, 0u, (tint_array_length < 8u))); |
| device tint_aliased_vec2_f32* const p2 = v_1; |
| (*p2).y = 3.0f; |
| } |
| |
| [[max_total_threads_per_threadgroup(1)]] |
| kernel void v_2(device array<uchar, 1>* v [[buffer(0)]], const constant tint_immediate_data_struct* tint_immediate_data [[buffer(30)]]) { |
| tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.v=v, .tint_immediate_data=tint_immediate_data}; |
| (foo(tint_module_vars.v, tint_array_lengths_struct{.tint_array_length_0_0=(*tint_module_vars.tint_immediate_data).tint_storage_buffer_sizes[0u]}.tint_array_length_0_0)); |
| } |