lDimensions.w,
        uv.y + imageHalfPixelDimensions.w);

    Coords = abs(round(frac(0.5 * Coords)) - frac(Coords));

    float4 t00 = tex2D(TextureSampler, float2(Coords[0], Coords[2]));
    float4 t10 = tex2D(TextureSampler, float2(Coords[1], Coords[2]));
    float4 t01 = tex2D(TextureSampler, float2(Coords[0], Coords[3]));
    float4 t11 = tex2D(TextureSampler, float2(Coords[1], Coords[3]));

    float2 xyInterp = frac(float2(Coords[0], Coords[2]) * imageHalfPixelDimensions.xy);

    if (Coords[1] < Coords[0])
    {
        xyInterp.x = 1 - xyInterp.x;
    }

    if (Coords[3] < Coords[2])
    {
        xyInterp.y = 1 - xyInterp.y;
    }

    float4 ty0 = lerp(t00, t10, xyInterp.x);
    float4 ty1 = lerp(t01, t11, xyInterp.x);

    psStageData.Color = lerp(ty0, ty1, xyInterp.y);
}
