blob: 8910f77b367f90ba15413d8e045ed31f76880190 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
template<typename T, size_t N>
struct tint_array {
const constant T& operator[](size_t i) const constant { return elements[i]; }
device T& operator[](size_t i) device { return elements[i]; }
const device T& operator[](size_t i) const device { return elements[i]; }
thread T& operator[](size_t i) thread { return elements[i]; }
const thread T& operator[](size_t i) const thread { return elements[i]; }
threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
T elements[N];
};
struct tint_module_vars_struct {
const constant tint_array<half2x3, 4>* a;
device half* s;
};
kernel void f(const constant tint_array<half2x3, 4>* a [[buffer(0)]], device half* s [[buffer(1)]]) {
tint_module_vars_struct const tint_module_vars = {.a=a, .s=s};
const constant tint_array<half2x3, 4>* const p_a = tint_module_vars.a;
const constant half2x3* const p_a_2 = (&(*p_a)[2]);
const constant half3* const p_a_2_1 = (&(*p_a_2)[1]);
tint_array<half2x3, 4> const l_a = (*p_a);
half2x3 const l_a_i = (*p_a_2);
half3 const l_a_i_i = (*p_a_2_1);
(*tint_module_vars.s) = ((((*p_a_2_1)[0u] + l_a[0][0][0u]) + l_a_i[0][0u]) + l_a_i_i[0u]);
}