interpolation float4 v0 : TEXCOORD0;
    nointerpolation float4 v1 : TEXCOORD1;
    nointerpolation float4 v2 : TEXCOORD2;
    nointerpolation float4 v3 : TEXCOORD3;
    float2 v4 : TEXCOORD4;
    float2 v5 : TEXCOORD5;
    nointerpolation float2 v6 : TEXCOORD6;
    nointerpolation float2 v7 : TEXCOORD7;
};

#pragma warning( disable: 3556 3571 )
int2 ivec2_ctor(float2 x0)
{
    return int2(x0);
}
// Uniforms

static const uint _sColor0 = 0;
static const uint _sClipMask = 1;
uniform Texture2D<float4> textures2D[2] : register(t0);
uniform SamplerState samplers2D[2] : register(s0);
#ifdef ANGLE_ENABLE_LOOP_FLATTEN
#define LOOP [loop]
#define FLATTEN [flatten]
#else
#define LOOP
#define FLATTEN
#endif

#define ATOMIC_COUNTER_ARRAY_STRIDE 4

// Varyings
static nointerpolation float4 _vClipMaskUvBounds = {0, 0, 0, 0};
static  float2 _vClipMaskUv = {0, 0};
static  float2 _v_uv = {0, 0};
static nointerpolation float4 _v_color = {0, 0, 0, 0};
static nointerpolation float2 _v_mask_swizzle = {0, 0};
static nointerpolation float4 _v_uv_bounds = {0, 0, 0, 0};
static nointerpolation float4 _v_uv_sample_bounds = {0, 0, 0, 0};
static nointerpolation float2 _v_perspective = {0, 0};

static float4 out_oFragColor = {0, 0, 0, 0};
static float4 gl_FragCoord = float4(0, 0, 0, 0);

cbuffer DriverConstants : register(b1)
{
    float4 dx_ViewCoords : packoffset(c1);
    float2 dx_FragCoordOffset : packoffset(c3);
    float3 dx_DepthFront : packoffset(c2);
    float2 dx_ViewScale : packoffset(c3.z);
    struct SamplerMetadata
    {
        int baseLevel;
        int internalFormatBits;
        int wrapModes;
        int padding;
        int4 intBorderColor;
    };
    SamplerMetadata samplerMetadata[2] : packoffset(c5);
};

float4 gl_texture2D(uint samplerIndex, float2 t)
{
    return textures2D[samplerIndex].Sample(samplers2D[samplerIndex], float2(t.x, t.y));
}

float4 gl_texture2DFetch(uint samplerIndex, int2 t, int mip)
{
    return textures2D[samplerIndex].Load(int3(t.x, t.y, mip));
}

#define GL_USES_FRAG_COORD
@@ PIXEL OUTPUT @@

PS_OUTPUT main(PS_INPUT input){
    float rhw = 1.0 / input.gl_FragCoord.w;
    gl_FragCoord.x = input.dx_Position.x - dx_FragCoordOffset.x;
    gl_FragCoord.y = input.dx_Position.y - dx_FragCoordOffset.y;
    gl_FragCoord.z = (input.gl_FragCoord.z * rhw) * dx_DepthFront.x + dx_DepthFront.y;
    gl_FragCoord.w = rhw;
    _vClipMaskUvBounds = input.v0;
    _v_color = input.v1;
    _v_uv_bounds = input.v2;
    _v_uv_sample_bounds = input.v3;
    _vClipMaskUv = input.v4.xy;
    _v_uv = input.v5.xy;
    _v_mask_swizzle = input.v6.xy;
    _v_perspective = input.v7.xy;

float4 _frag_color_15617 = {0, 0, 0, 0};
float4 _texel_25618 = {0, 0, 0, 0};
float4 _tmpvar_35619 = {0, 0, 0, 0};
(_tmpvar_35619 = gl_texture2D(_sColor0, min(max(((_v_uv * lerp(gl_FragCoord.w, 1.0, _v_perspective.x)) + _v_uv_bounds.xy), _v_uv_sample_bounds.xy), _v_uv_sample_bounds.zw)));
(_texel_25618.w = _tmpvar_35619.w);
(_texel_25618.xyz = ((_tmpvar_35619.xyz * _v_mask_swizzle.x) + (_tmpvar_35619.www * _v_mask_swizzle.y)));
(_frag_color_15617 = (_v_color * _texel_25618));
float _tmpvar_45620 = {0};
if (all(_vClipMaskUvBounds.xy == _vClipMaskUvBounds.zw))
{
(_tmpvar_45620 = 1.0);
}
else
{
float2 _tmpvar_55621 = {0, 0};
(_tmpvar_55621 = (_vClipMaskUv * gl_FragCoord.w));
bool4 _tmpvar_65622 = {0, 0, 0, 0};
(_tmpvar_65622.xy = (_tmpvar_55621 >= _vClipMaskUvBounds.xy));
(_tmpvar_65622.zw = (_tmpvar_55621 < _vClipMaskUvBounds.zw));
bool _tmpvar_75623 = {0};
(_tmpvar_75623 = all(_tmpvar_65622 == bool4(true, true, true, true)));
if ((!_tmpvar_75623))
{
(_tmpvar_45620 = 0.0);
}
else
{
(_tmpvar_45620 = gl_texture2DFetch(_sClipMask, ivec2_ctor(_tmpvar_55621), 0).x);
}
}
(_frag_color_15617 = (_frag_color_15617 * _tmpvar_45620));
(out_oFragColor = _frag_color_15617);
return generateOutput();
}
