From 678b750128e8954092e2d3e3820939e0cea9cff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Mon, 11 Dec 2023 07:42:29 -0800 Subject: [PATCH] Fixed calcNumMips for non-power-of-2 texture dimensions. --- src/bimg_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bimg_p.h b/src/bimg_p.h index ff968d8..52e759b 100644 --- a/src/bimg_p.h +++ b/src/bimg_p.h @@ -85,7 +85,7 @@ namespace bimg if (_hasMips) { const uint32_t max = bx::max(_width, _height, _depth); - const uint32_t num = 1 + bx::ceilLog2(max); + const uint32_t num = 1 + bx::floorLog2(max); return uint8_t(num); }