Fix texture streaming minimum mips to load for block compressed textures
This commit is contained in:
@@ -110,6 +110,14 @@ bool StreamingTexture::Create(const TextureHeader& header)
|
||||
// That's one of the main advantages of the current resources streaming system.
|
||||
_header = header;
|
||||
_isBlockCompressed = PixelFormatExtensions::IsCompressed(_header.Format);
|
||||
if (_isBlockCompressed)
|
||||
{
|
||||
// Ensure that streaming doesn't go too low because the hardware expects the texture to be min in size of compressed texture block
|
||||
int32 lastMip = header.MipLevels - 1;
|
||||
while (header.Width >> lastMip < 4 && header.Height >> lastMip < 4)
|
||||
lastMip--;
|
||||
_minMipCountBlockCompressed = header.MipLevels - lastMip + 1;
|
||||
}
|
||||
|
||||
// Request resource streaming
|
||||
#if GPU_ENABLE_TEXTURES_STREAMING
|
||||
|
||||
Reference in New Issue
Block a user