Skip to content

Commit

Permalink
Fix max miplevel calculation from image's dimensions in TextureLoader
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mmaurer authored and facebook-github-bot committed Sep 11, 2023
1 parent 2e8846a commit 94286a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion IGLU/texture_loader/ktx1/TextureLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 94286a3

Please sign in to comment.