From 94286a33215d928dd866032a43e304e96fce34ef Mon Sep 17 00:00:00 2001 From: Mauricio Maurer Date: Mon, 11 Sep 2023 11:24:52 -0700 Subject: [PATCH] Fix max miplevel calculation from image's dimensions in TextureLoader Summary: There was a typo where the max mip level calculation was being done. We we're getting the width for both the width and height. Reviewed By: EricGriffith, dmannemela, syeh1, corporateshark Differential Revision: D49150174 fbshipit-source-id: a6a42a39ca8306dd2e753f043363bc989145c9cd --- IGLU/texture_loader/ktx1/TextureLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IGLU/texture_loader/ktx1/TextureLoader.cpp b/IGLU/texture_loader/ktx1/TextureLoader.cpp index 4b5f0aa87e..6b80deb384 100644 --- a/IGLU/texture_loader/ktx1/TextureLoader.cpp +++ b/IGLU/texture_loader/ktx1/TextureLoader.cpp @@ -71,7 +71,7 @@ bool TextureLoader::isHeaderValid(DataReader reader, igl::Result* IGL_NULLABLE o } const uint32_t width = std::max(header->pixelWidth, 1u); - const uint32_t height = std::max(header->pixelWidth, 1u); + const uint32_t height = std::max(header->pixelHeight, 1u); const uint32_t maxMipLevels = igl::TextureDesc::calcNumMipLevels(width, height); if (header->numberOfMipmapLevels > maxMipLevels) { igl::Result::setResult(