src/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
// When blitting, the source and destination areas are viewed like UVs.  For example, a 64x64
// texture if flipped should have an offset of 64 in either X or Y which corresponds to U or V of 1.
// On the other hand, when resolving, the source and destination areas are used as fragment
// coordinates to fetch from.  In that case, when flipped, the texture in the above example must
// have an offset of 63.
When blitting, the source and destination areas are viewed like UVs.  For example, a 64x64
texture if flipped should have an offset of 64 in either X or Y which corresponds to U or V of 1.
On the other hand, when resolving, the source and destination areas are used as fragment
coordinates to fetch from.  In that case, when flipped, the texture in the above example must
have an offset of 63.
When blitting the source and destination areas are viewed like UVs . For example a 64x64 texture if flipped should have an offset of 64 in either X or Y which corresponds to U or V of 1 . On the other hand when resolving the source and destination areas are used as fragment coordinates to fetch from . In that case when flipped the texture in the above example must have an offset of 63 .
void AdjustBlitResolveParametersForResolve(const gl::Rectangle &sourceArea,
                                           const gl::Rectangle &destArea,
                                           UtilsVk::BlitResolveParameters *params)
{
    params->srcOffset[0]  = sourceArea.x;
    params->srcOffset[1]  = sourceArea.y;
    params->destOffset[0] = destArea.x;
    params->destOffset[1] = destArea.y;
    if (sourceArea.isReversedX())
    {
        ASSERT(sourceArea.x > 0);
        --params->srcOffset[0];
    }
    if (sourceArea.isReversedY())
    {
        ASSERT(sourceArea.y > 0);
        --params->srcOffset[1];
    }
    if (destArea.isReversedX())
    {
        ASSERT(destArea.x > 0);
        --params->destOffset[0];
    }
    if (destArea.isReversedY())
    {
        ASSERT(destArea.y > 0);
        --params->destOffset[1];
    }
}
void AdjustBlitResolveParametersForResolve ( const gl :: Rectangle & sourceArea , const gl :: Rectangle & destArea , UtilsVk :: BlitResolveParameters * params ) { params -> srcOffset [ 0 ] = sourceArea . x ; params -> srcOffset [ 1 ] = sourceArea . y ; params -> destOffset [ 0 ] = destArea . x ; params -> destOffset [ 1 ] = destArea . y ; if ( sourceArea . isReversedX ( ) ) { ASSERT ( sourceArea . x > 0 ) ; -- params -> srcOffset [ 0 ] ; } if ( sourceArea . isReversedY ( ) ) { ASSERT ( sourceArea . y > 0 ) ; -- params -> srcOffset [ 1 ] ; } if ( destArea . isReversedX ( ) ) { ASSERT ( destArea . x > 0 ) ; -- params -> destOffset [ 0 ] ; } if ( destArea . isReversedY ( ) ) { ASSERT ( destArea . y > 0 ) ; -- params -> destOffset [ 1 ] ; } }
When blitting, the source and destination areas are viewed like UVs.
When blitting the source and destination areas are viewed like UVs .