From 4071390ca5413a24007d5fc354325d6a0d500e38 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 22 Sep 2026 22:59:43 +0200 Subject: [PATCH] Fix streaming of block-compressed wide/tall textures --- Source/Engine/Graphics/Textures/StreamingTexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Engine/Graphics/Textures/StreamingTexture.cpp b/Source/Engine/Graphics/Textures/StreamingTexture.cpp index 93cfb4565..dddd1c636 100644 --- a/Source/Engine/Graphics/Textures/StreamingTexture.cpp +++ b/Source/Engine/Graphics/Textures/StreamingTexture.cpp @@ -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); }