Fix streaming of block-compressed wide/tall textures

This commit is contained in:
Tim
2026-09-22 23:05:55 +02:00
parent 2b5ea33df0
commit 4071390ca5
@@ -115,7 +115,7 @@ bool StreamingTexture::Create(const TextureHeader& header)
// Ensure that streaming doesn't go too low because the hardware expects the texture to be min in size of compressed texture block
const int32 blockSize = PixelFormatExtensions::ComputeBlockSize(_header.Format);
int32 lastMip = header.MipLevels - 1;
while ((header.Width >> lastMip) < blockSize && (header.Height >> lastMip) < blockSize && lastMip > 0)
while (Math::Min(header.Width >> lastMip, header.Height >> lastMip) < blockSize && lastMip > 0)
lastMip--;
_minMipCountBlockCompressed = Math::Min(header.MipLevels - lastMip + 1, header.MipLevels);
}