// UI + on screen elements
#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 _43_45
{
    vec4 _m0;
    vec4 _m1;
    vec4 _m2;
    vec4 _m3;
    vec4 _m4;
    vec4 _m5;
} _45;

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

layout(push_constant, std430) uniform _217_219
{
    int _m0;
    int _m1;
} _219;

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

layout(location = 0) in vec4 _158;
layout(location = 2) out vec4 _187;
layout(location = 1) in vec2 _190;
layout(location = 0) out vec4 _197;
layout(location = 3) in vec4 _198;
layout(location = 3) out vec4 _200;
layout(location = 9) in vec4 _201;

mat4 _23(mat4 _21, mat4 _22)
{
    return _21 * _22;
}

float _16(vec4 _14, vec4 _15)
{
    return dot(_14, _15);
}

vec4 _11(vec4 _10)
{
    return clamp(_10, vec4(0.0), vec4(1.0));
}

void main()
{
    vec4 _131;
    vec4 _134;
    vec4 _137;
    vec4 _140;
    if (_45._m0.x > 0.0)
    {
        mat4 _57 = mat4(vec4(_45._m1), vec4(_45._m2), vec4(_45._m3), vec4(_45._m4));
        mat4 _92 = mat4(vec4(_95._m0), vec4(_95._m1), vec4(_95._m2), vec4(_95._m3));
        mat4 _126 = _57;
        mat4 _128 = _92;
        mat4 _125 = _23(_126, _128);
        _131 = _125[0];
        _134 = _125[1];
        _137 = _125[2];
        _140 = _125[3];
    }
    else
    {
        _131 = _45._m1;
        _134 = _45._m2;
        _137 = _45._m3;
        _140 = _45._m4;
    }
    vec4 _159 = _158;
    vec4 _161 = _131;
    gl_Position.x = _16(_159, _161);
    vec4 _166 = _158;
    vec4 _168 = _134;
    gl_Position.y = _16(_166, _168);
    vec4 _172 = _158;
    vec4 _174 = _137;
    gl_Position.z = _16(_172, _174);
    vec4 _179 = _158;
    vec4 _181 = _140;
    gl_Position.w = _16(_179, _181);
    _187 = vec4(_190.x, _190.y, 0.0, 0.0);
    _197 = _198;
    vec4 _206 = _201 * vec4(1.0039370059967041015625);
    _200 = (_11(_206) * vec4(2.0)) - vec4(1.0);
    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;
	}
}



