1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2024-12-01 13:24:20 +01:00

fixed mipmap generation

This commit is contained in:
yours3lf 2020-05-15 21:20:01 +01:00
parent f895f5e934
commit fe78d23650
3 changed files with 5 additions and 15 deletions

View File

@ -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:

View File

@ -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;

View File

@ -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;