From 9caa08b7f0be7814581eb29241703670f2e1c08e Mon Sep 17 00:00:00 2001 From: Lukas Aldershaab Date: Sat, 2 Jan 2021 18:19:26 +0100 Subject: [PATCH] Fix off-by-one in mip levels for OpenGL --- Engine/source/gfx/gl/gfxGLUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/gfx/gl/gfxGLUtils.h b/Engine/source/gfx/gl/gfxGLUtils.h index e8ab45be8..8d235d6b9 100644 --- a/Engine/source/gfx/gl/gfxGLUtils.h +++ b/Engine/source/gfx/gl/gfxGLUtils.h @@ -30,7 +30,7 @@ inline U32 getMaxMipmaps(U32 width, U32 height, U32 depth) { - return getMax( getBinLog2(depth), getMax(getBinLog2(width), getBinLog2(height))); + return getMax( getBinLog2(depth), getMax(getBinLog2(width), getBinLog2(height))) + 1; } inline GLenum minificationFilter(U32 minFilter, U32 mipFilter, U32 /*mipLevels*/)