// Reflection pixel
#version 460
 #extension GL_EXT_multiview : enable
// Vk3DVision SinglePass
///////////////////////////////////////////////////////////////////////////////

#define STEREO 1

#define VIEW gl_ViewIndex

// Stereo and Mono Texture Sampling
#if(STEREO == 1)
	#define SAMPLER_2D sampler2DArray
	#define USAMPLER_2D usampler2DArray
	#define ISAMPLER_2D isampler2DArray
	#define IMAGE_2D image2DArray
	#define UIMAGE_2D uimage2DArray
	#define TEXTURE_2D texture2DArray
	#define SAMPLE_TEXTURE(Sampler, uv) texture(Sampler, vec3(uv, VIEW))
	#define SAMPLE_TEXTURE1(Sampler, uv, bias) texture(Sampler, vec3(uv, VIEW), bias)
	#define IMAGE_LOAD(Image2D, pos) imageLoad(Image2D, ivec3(pos, VIEW))
	#define IMAGE_STORE(Image2D, pos, result) imageStore(Image2D, ivec3(pos, VIEW), result)
	#define TEXEL_FETCH(Sampler, uv, lod) texelFetch(Sampler, ivec3(uv, VIEW), lod)
	#define TEXEL_FETCH_OFFSET(Sampler, uv, lod, offset) texelFetchOffset(Sampler, ivec3(uv, VIEW), lod, offset)
	#define TEXTURE_LOD(Sampler, uv, lod) textureLod(Sampler, vec3(uv, VIEW), lod)
	#define TEXTURE_LOD_OFFSET(Sampler, uv, lod, offset) textureLodOffset(Sampler, vec3(uv, VIEW), lod, offset)
	#define TEXTURE_GATHER(Sampler, uv, comp) textureGather(Sampler, vec3(uv, VIEW), comp)
	#define TEXTURE_GATHER1(Sampler, uv) textureGather(Sampler, vec3(uv, VIEW))
	#define TEXTURE_GATHER_OFFSET(Sampler, uv, offset, comp) textureGatherOffset(Sampler, vec3(uv, VIEW), offset, comp)
	#define TEXTURE_GATHER_OFFSETS(Sampler, uv, offset) textureGatherOffsets(Sampler, vec3(uv, VIEW), offset)
	#define TEXTURE_GATHER_OFFSETS1(Sampler, uv, offset, comp) textureGatherOffsets(Sampler, vec3(uv, VIEW), offset, comp)
	#define TEXTURE_SIZE(Sampler, lod) textureSize(Sampler, lod).xy
	#define TEXTURE_GRAD(Sampler, P, dPdx, dPdy) textureGrad(Sampler, vec3(P, VIEW), dPdx, dPdy)
#else
	#define SAMPLER_2D sampler2D
	#define USAMPLER_2D usampler2D
	#define ISAMPLER_2D isampler2D
	#define IMAGE_2D image2D
	#define UIMAGE_2D uimage2D
	#define TEXTURE_2D texture2D
	#define SAMPLE_TEXTURE(Sampler, uv) texture(Sampler, uv)
	#define SAMPLE_TEXTURE1(Sampler, uv, bias) texture(Sampler, uv, bias)
	#define IMAGE_LOAD(Image2D, pos) imageLoad(Image2D, pos)
	#define IMAGE_STORE(Image2D, pos, result) imageStore(Image2D, pos, result)
	#define TEXEL_FETCH(Sampler, uv, lod) texelFetch(Sampler, uv, lod)
	#define TEXEL_FETCH_OFFSET(Sampler, uv, lod, offset) texelFetchOffset(Sampler, uv, lod, offset)
	#define TEXTURE_LOD(Sampler, uv, lod) textureLod(Sampler, uv, lod)
	#define TEXTURE_LOD_OFFSET(Sampler, uv, lod, offset) textureLodOffset(Sampler, uv, lod, offset)
	#define TEXTURE_GATHER(Sampler, uv, comp) textureGather(Sampler, uv, comp)
	#define TEXTURE_GATHER1(Sampler, uv, comp) textureGather(Sampler, uv, comp)
	#define TEXTURE_GATHER_OFFSET(Sampler, uv, offset, comp) textureGatherOffset(Sampler, uv, offset, comp)
	#define TEXTURE_GATHER_OFFSETS(Sampler, uv, offset) textureGatherOffsets(Sampler, uv, offset)
	#define TEXTURE_GATHER_OFFSETS1(Sampler, uv, offset, comp) textureGatherOffsets(Sampler, uv, offset, comp)
	#define TEXTURE_SIZE(Sampler, lod) textureSize(Sampler, lod)
	#define TEXTURE_GRAD(Sampler, P, dPdx, dPdy) textureGrad(Sampler, P, dPdx, dPdy)
#endif 
 ///////////////////////////////////////////////////////////////////////////////
layout(early_fragment_tests) in;

layout(set = 0, binding = 0, std140) uniform _77_79
{
    vec4 _m0;
    vec4 _m1;
    vec4 _m2;
    vec4 _m3;
    vec4 _m4;
    vec4 _m5;
    vec4 _m6;
    vec4 _m7;
    vec4 _m8;
    vec4 _m9;
    vec4 _m10;
    vec4 _m11;
    vec4 _m12;
    vec4 _m13;
    vec4 _m14;
    vec4 _m15;
    vec4 _m16;
    vec4 _m17;
    vec4 _m18;
    vec4 _m19;
    vec4 _m20;
    vec4 _m21;
    vec4 _m22;
    vec4 _m23;
    vec4 _m24;
    vec4 _m25;
    vec4 _m26;
    vec4 _m27;
    vec4 _m28;
    vec4 _m29;
    float _m30;
    float _m31;
    float _m32;
    float _m33;
    float _m34;
    float _m35;
    float _m36;
    float _m37;
    float _m38;
    float _m39;
    float _m40;
    float _m41;
    float _m42;
    float _m43;
    float _m44;
    float _m45;
    float _m46;
    float _m47;
    uint _m48;
    float _m49;
    float _m50;
    float _m51;
    float _m52;
    float _m53;
    float _m54;
    float _m55;
    float _m56;
    float _m57;
    float _m58;
    float _m59;
    float _m60;
    float _m61;
} _79;

layout(set = 0, binding = 1, std140) uniform _191_193
{
    vec4 _m0[64];
} _193;

layout(set = 1, binding = 0, std140) uniform _195_197
{
    vec4 _m0;
    vec4 _m1;
    vec4 _m2;
    vec4 _m3;
    float _m4;
    float _m5;
    uint _m6;
    float _m7;
    float _m8;
    float _m9;
    float _m10;
    float _m11;
    int _m12;
    uint _m13;
    float _m14[2];
} _197;

layout(set = 2, binding = 0, std140) uniform _199_201
{
    vec4 _m0;
    vec4 _m1;
    vec4 _m2;
    vec4 _m3;
    vec4 _m4;
    vec4 _m5;
    vec4 _m6;
    vec4 _m7;
    vec4 _m8;
    vec4 _m9;
    vec4 _m10;
    vec4 _m11;
    vec4 _m12;
    float _m13;
    float _m14;
    uint _m15;
    uint _m16;
    uint _m17;
    uint _m18;
    float _m19;
    uint _m20;
    uint _m21;
    float _m22;
    float _m23;
    uint _m24;
    float _m25;
    uint _m26;
    float _m27;
    float _m28;
    float _m29;
    float _m30;
    float _m31;
    float _m32;
    float _m33;
    float _m34;
    float _m35;
    float _m36;
    float _m37;
    float _m38;
    float _m39;
    float _m40;
    float _m41;
    float _m42;
    float _m43;
    float _m44;
    uint _m45;
    float _m46[3];
} _201;

layout(push_constant, std430) uniform _175_177
{
    int _m0;
    int _m1;
    int _m2;
} _177;

layout(set = 0, binding = 15) uniform texture2D _135;
layout(set = 0, binding = 16) uniform sampler _139;

layout(location = 0, component = 0) out vec4 _186;
layout(location = 0, component = 0) in vec4 _202;
layout(location = 2, component = 0) in vec4 _203;
layout(location = 3, component = 0) in vec4 _204;
layout(location = 4, component = 0) in vec4 _205;
layout(location = 5, component = 0) in vec4 _206;
layout(location = 6, component = 0) in vec4 _207;
layout(location = 7, component = 0) in vec4 _208;
layout(location = 8, component = 0) in vec4 _209;
layout(location = 10, component = 0) in vec4 _210;
layout(location = 11, component = 0) in vec4 _211;
layout(location = 12, component = 0) in vec4 _212;
layout(location = 17, component = 3) in float _213;
layout(location = 18, component = 0) in float _214;
layout(location = 18, component = 1) in float _215;
layout(location = 18, component = 2) in float _216;
layout(location = 18, component = 3) in float _217;
layout(location = 19, component = 0) in float _218;
layout(location = 19, component = 1) in float _219;
layout(location = 19, component = 2) in float _220;
layout(location = 19, component = 3) in float _221;
layout(location = 20, component = 0) in float _222;
layout(location = 20, component = 1) in float _223;
layout(location = 20, component = 2) in float _224;
uint _25;
uint _27;
uint _29;
uint _31;
uint _33;
uint _35;
uint _37;
uint _38;
uint _40;
uint _41;
uint _43;
uint _45;
uint _47;
uint _49;
uint _51;
uint _53;
uint _55;
uint _57;
uint _59;

float _10(float _9)
{
    return clamp(_9, 0.0, 1.0);
}

float _21(inout float _19, bool _20)
{
    if (_20)
    {
        _19 += (float(_19 < _79._m30) * _79._m31);
    }
    float _97 = _19;
    return _79._m0.w / (_10(_97) + _79._m0.z);
}

void _14(float _13)
{
    if (_13 < 0.0)
    {
        discard;
    }
}

void main()
{
    _25 = 2147483648u;
    _27 = 1073741824u;
    _29 = 0u;
    _31 = 268435456u;
    _33 = 536870912u;
    _35 = 805306368u;
    _37 = 1073741824u;
    _38 = 1342177280u;
    _40 = 0u;
    _41 = 16777216u;
    _43 = 33554432u;
    _45 = 50331648u;
    _47 = 67108864u;
    _49 = 83886080u;
    _51 = 100663296u;
    _53 = 117440512u;
    _55 = 134217728u;
    _57 = 150994944u;
    _59 = 167772160u;
    vec2 _109 = (vec4(gl_FragCoord.xy, 1.0 - gl_FragCoord.z, gl_FragCoord.w).xy * _79._m29.xy) * 2.0;
    float _157 = 1.0 - textureLod(sampler2D(_135, _139), vec4(_109, 0.0, 0.0).xy, vec4(_109, 0.0, 0.0).w).x;
    bool _158 = false;
    float _159 = _21(_157, _158);
    float _132 = _159;
    float _164 = 1.0 - gl_FragCoord.z;
    bool _165 = false;
    float _166 = _21(_164, _165);
    float _160 = _166;
    float _167 = _132 - _160;
    float _171 = _167;
    _14(_171);
    float _174 = float(_177._m2) / 255.0;
    _186 = vec4(_174, 0.0, 0.0, 0.0);
}


