diff --git a/driver/common.c b/driver/common.c index bd439a3..05e93c1 100644 --- a/driver/common.c +++ b/driver/common.c @@ -210,7 +210,7 @@ uint32_t isLTformat(uint32_t bpp, uint32_t width, uint32_t height) { uint32_t utileW, utileH; getUTileDimensions(bpp, &utileW, &utileH); - return (width <= 4 * utileW || height <= utileH); + return (width <= 4 * utileW || height <= 4 * utileH); } //Textures in T format: diff --git a/driver/copy.c b/driver/copy.c index 583fd3a..8461fb9 100644 --- a/driver/copy.c +++ b/driver/copy.c @@ -1097,10 +1097,10 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkCmdBlitImage( for(uint32_t c = 0; c < regionCount; ++c) { - uint32_t srcWidth = pRegions[c].srcOffsets[1].x - pRegions[c].srcOffsets[0].x; - uint32_t srcHeight = pRegions[c].srcOffsets[1].y - pRegions[c].srcOffsets[0].y; - uint32_t dstWidth = pRegions[c].dstOffsets[1].x - pRegions[c].dstOffsets[0].x; - uint32_t dstHeight = pRegions[c].dstOffsets[1].y - pRegions[c].dstOffsets[0].y; + uint32_t srcWidth = max(pRegions[c].srcOffsets[1].x - pRegions[c].srcOffsets[0].x, 1); + uint32_t srcHeight = max(pRegions[c].srcOffsets[1].y - pRegions[c].srcOffsets[0].y, 1); + uint32_t dstWidth = max(pRegions[c].dstOffsets[1].x - pRegions[c].dstOffsets[0].x, 1); + uint32_t dstHeight = max(pRegions[c].dstOffsets[1].y - pRegions[c].dstOffsets[0].y, 1); uint32_t srcMipLevel = pRegions[c].srcSubresource.mipLevel; uint32_t dstMipLevel = pRegions[c].dstSubresource.mipLevel; diff --git a/driver/resource.c b/driver/resource.c index 8c8d53f..79d6d1d 100644 --- a/driver/resource.c +++ b/driver/resource.c @@ -350,16 +350,6 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkGetImageMemoryRequirements( } } - if(mipW < 4) - { - mipW = 4; - } - - if(mipH < 4) - { - mipH = 4; - } - i->levelOffsets[c] = offset; strides[c] = (mipW * bpp * max(i->samples, 1)) >> 3;