| 1 |
#pragma clang diagnostic ignored "-Wmissing-prototypes" |
| 2 |
|
| 3 |
#include <metal_stdlib> |
| 4 |
#include <simd/simd.h> |
| 5 |
|
| 6 |
using namespace metal; |
| 7 |
|
| 8 |
struct Block |
| 9 |
{ |
| 10 |
float3x4 var[3][4]; |
| 11 |
}; |
| 12 |
|
| 13 |
struct main0_out |
| 14 |
{ |
| 15 |
float v_vtxResult [[user(locn0)]]; |
| 16 |
float4 gl_Position [[position]]; |
| 17 |
}; |
| 18 |
|
| 19 |
struct main0_in |
| 20 |
{ |
| 21 |
float4 a_position [[attribute(0)]]; |
| 22 |
}; |
| 23 |
|
| 24 |
static inline __attribute__((always_inline)) |
| 25 |
float compare_float(thread const float& a, thread const float& b) |
| 26 |
{ |
| 27 |
return float(abs(a - b) < 0.0500000007450580596923828125); |
| 28 |
} |
| 29 |
|
| 30 |
static inline __attribute__((always_inline)) |
| 31 |
float compare_vec3(thread const float3& a, thread const float3& b) |
| 32 |
{ |
| 33 |
float param = a.x; |
| 34 |
float param_1 = b.x; |
| 35 |
float param_2 = a.y; |
| 36 |
float param_3 = b.y; |
| 37 |
float param_4 = a.z; |
| 38 |
float param_5 = b.z; |
| 39 |
return (compare_float(param, param_1) * compare_float(param_2, param_3)) * compare_float(param_4, param_5); |
| 40 |
} |
| 41 |
|
| 42 |
static inline __attribute__((always_inline)) |
| 43 |
float compare_mat2x3(thread const float2x3& a, thread const float2x3& b) |
| 44 |
{ |
| 45 |
float3 param = a[0]; |
| 46 |
float3 param_1 = b[0]; |
| 47 |
float3 param_2 = a[1]; |
| 48 |
float3 param_3 = b[1]; |
| 49 |
return compare_vec3(param, param_1) * compare_vec3(param_2, param_3); |
| 50 |
} |
| 51 |
|
| 52 |
vertex main0_out main0(main0_in in [[stage_in]], constant Block& _104 [[buffer(0)]]) |
| 53 |
{ |
| 54 |
main0_out out = {}; |
| 55 |
out.gl_Position = in.a_position; |
| 56 |
float result = 1.0; |
| 57 |
float2x3 param = transpose(float3x2(_104.var[0][0][0].xy, _104.var[0][0][1].xy, _104.var[0][0][2].xy)); |
| 58 |
float2x3 param_1 = float2x3(float3(2.0, 6.0, -6.0), float3(0.0, 5.0, 5.0)); |
| 59 |
result *= compare_mat2x3(param, param_1); |
| 60 |
out.v_vtxResult = result; |
| 61 |
return out; |
| 62 |
} |
| 63 |
|