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:
parent
f895f5e934
commit
fe78d23650
@ -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:
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user