blob: 226eeed16ce3e32e7b691ab5c654b06a1dafe9e8 [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<half2x4, 4>* u;
device half* s;
};
half a(tint_array<half2x4, 4> a) {
return a[0][0][0u];
}
half b(half2x4 m) {
return m[0][0u];
}
half c(half4 v) {
return v[0u];
}
half d(half f) {
return f;
}
kernel void f(const constant tint_array<half2x4, 4>* u [[buffer(0)]], device half* s [[buffer(1)]]) {
tint_module_vars_struct const tint_module_vars = {.u=u, .s=s};
half const v_1 = a((*tint_module_vars.u));
half const v_2 = (v_1 + b((*tint_module_vars.u)[1]));
half const v_3 = (v_2 + c((*tint_module_vars.u)[1][0].ywxz));
(*tint_module_vars.s) = (v_3 + d((*tint_module_vars.u)[1][0].ywxz[0u]));
}