// UI
#version 450
 #extension GL_EXT_multiview : enable
#define VIEW gl_ViewIndex


// Vk3DVision (http://3dsurroundgaming.com/) - Stereo Injection
 
struct Vk3DStereo
{
	vec4 stereo;
	vec4 custom_params;
};
layout(set = 0, binding = 10, std140) uniform Vk3DParams
{
	Vk3DStereo vk3d_params[2];
};


   

layout(set = 1, binding = 0, std140) uniform _31_33
{
    vec4 _m0;
    vec4 _m1;
    vec4 _m2;
    vec4 _m3;
    vec4 _m4;
    vec4 _m5;
} _33;

layout(set = 0, binding = 0, std140) uniform _83_85
{
    vec4 _m0;
    vec4 _m1;
    vec4 _m2;
    vec4 _m3;
    vec4 _m4;
} _85;

layout(push_constant, std430) uniform _221_223
{
    int _m0;
    int _m1;
} _223;

layout(set = 2, binding = 1) uniform sampler2D _227;

layout(location = 0) in vec4 _148;
layout(location = 2) out vec4 _205;
layout(location = 1) in vec2 _207;
layout(location = 0) out vec4 _214;
layout(location = 3) in vec4 _215;

mat4 _19(mat4 _17, mat4 _18)
{
    return _17 * _18;
}

float _12(vec4 _10, vec4 _11)
{
    return dot(_10, _11);
}

void main()
{
    vec4 _121;
    vec4 _124;
    vec4 _127;
    vec4 _130;
    if (_33._m0.x > 0.0)
    {
        mat4 _46 = mat4(vec4(_33._m1), vec4(_33._m2), vec4(_33._m3), vec4(_33._m4));
        mat4 _82 = mat4(vec4(_85._m0), vec4(_85._m1), vec4(_85._m2), vec4(_85._m3));
        mat4 _116 = _46;
        mat4 _118 = _82;
        mat4 _115 = _19(_116, _118);
        _121 = _115[0];
        _124 = _115[1];
        _127 = _115[2];
        _130 = _115[3];
    }
    else
    {
        _121 = _33._m1;
        _124 = _33._m2;
        _127 = _33._m3;
        _130 = _33._m4;
    }
    vec4 _149 = _148;
    vec4 _151 = _121;
    gl_Position.x = _12(_149, _151);
    vec4 _156 = _148;
    vec4 _158 = _124;
    gl_Position.y = _12(_156, _158);
    vec4 _162 = _148;
    vec4 _164 = _127;
    gl_Position.z = _12(_162, _164);
    vec4 _169 = _148;
    vec4 _171 = _130;
    gl_Position.w = _12(_169, _171);
    vec2 _178 = _33._m5.xy;
    vec2 _183 = normalize(gl_Position.xy - _178);
    vec2 _201 = gl_Position.xy + (_183 * (_33._m5.w * _33._m5.z));
    gl_Position = vec4(_201.x, _201.y, gl_Position.z, gl_Position.w);
    _205 = vec4(_207.x, _207.y, 0.0, 0.0);
    _214 = _215;
    gl_Position.y = -gl_Position.y;

// Vk3DVision (http://3dsurroundgaming.com/) - Stereo Injection
	gl_Position.x += vk3d_params[VIEW].stereo.x * vk3d_params[VIEW].custom_params.x;
	if (vk3d_params[VIEW].custom_params.y == 0 && vk3d_params[VIEW].custom_params.x != 0)
    {
		if (gl_Position.x <= -0.5)
	gl_Position.x += 0.6;
	
if (gl_Position.x >= 0.5)
	gl_Position.x -= 0.6;
	
if (gl_Position.y <= -0.5)
	gl_Position.y += 0.6;
	
if (gl_Position.y >= 0.5)
	gl_Position.y -= 0.5;
	}
}


