blob: ee913622d89a9d5bae47e7a4eba529a8f2823dfd [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_private_vars_struct {
float3 position_1;
float2 vUV;
float2 uv;
float3 normal;
float4 gl_Position;
};
struct strided_arr {
/* 0x0000 */ float el;
/* 0x0004 */ tint_array<int8_t, 12> tint_pad;
};
struct LeftOver {
/* 0x0000 */ float4x4 worldViewProjection;
/* 0x0040 */ float time;
/* 0x0044 */ tint_array<int8_t, 12> tint_pad_1;
/* 0x0050 */ tint_array<float4x4, 2> test2;
/* 0x00d0 */ tint_array<strided_arr, 4> test;
};
void main_1(thread tint_private_vars_struct* const tint_private_vars, const constant LeftOver* const tint_symbol_5) {
float4 q = 0.0f;
float3 p = 0.0f;
q = float4((*(tint_private_vars)).position_1[0], (*(tint_private_vars)).position_1[1], (*(tint_private_vars)).position_1[2], 1.0f);
p = q.xyz;
p[0] = (p[0] + sin((((*(tint_symbol_5)).test[0].el * (*(tint_private_vars)).position_1[1]) + (*(tint_symbol_5)).time)));
p[1] = (p[1] + sin(((*(tint_symbol_5)).time + 4.0f)));
(*(tint_private_vars)).gl_Position = ((*(tint_symbol_5)).worldViewProjection * float4(p[0], p[1], p[2], 1.0f));
(*(tint_private_vars)).vUV = (*(tint_private_vars)).uv;
(*(tint_private_vars)).gl_Position[1] = ((*(tint_private_vars)).gl_Position[1] * -1.0f);
return;
}
struct main_out {
float4 gl_Position;
float2 vUV_1;
};
struct tint_symbol_2 {
float3 position_1_param [[attribute(0)]];
float3 normal_param [[attribute(1)]];
float2 uv_param [[attribute(2)]];
};
struct tint_symbol_3 {
float2 vUV_1 [[user(locn0)]];
float4 gl_Position [[position]];
};
main_out tint_symbol_inner(float3 position_1_param, float2 uv_param, float3 normal_param, thread tint_private_vars_struct* const tint_private_vars, const constant LeftOver* const tint_symbol_6) {
(*(tint_private_vars)).position_1 = position_1_param;
(*(tint_private_vars)).uv = uv_param;
(*(tint_private_vars)).normal = normal_param;
main_1(tint_private_vars, tint_symbol_6);
main_out const tint_symbol_4 = {.gl_Position=(*(tint_private_vars)).gl_Position, .vUV_1=(*(tint_private_vars)).vUV};
return tint_symbol_4;
}
vertex tint_symbol_3 tint_symbol(const constant LeftOver* tint_symbol_7 [[buffer(0)]], tint_symbol_2 tint_symbol_1 [[stage_in]]) {
thread tint_private_vars_struct tint_private_vars = {};
main_out const inner_result = tint_symbol_inner(tint_symbol_1.position_1_param, tint_symbol_1.uv_param, tint_symbol_1.normal_param, &(tint_private_vars), tint_symbol_7);
tint_symbol_3 wrapper_result = {};
wrapper_result.gl_Position = inner_result.gl_Position;
wrapper_result.vUV_1 = inner_result.vUV_1;
return wrapper_result;
}