mirror of
https://github.com/bkaradzic/bimg.git
synced 2026-02-17 12:42:35 +01:00
Fix ktx parsing failing if texture array has 6 layers (#84)
* Fix ktx parsing failing if texture array has 6 layers Fixing line in code that assumes if numSides == 6 then it must be a cubemap even though numSides in this situation can refer to numLayers as well. * Update src/image.cpp confirmed this works and makes sense Co-authored-by: Raziel Alphadios <64050682+RazielXYZ@users.noreply.github.com> --------- Co-authored-by: Raziel Alphadios <64050682+RazielXYZ@users.noreply.github.com>
This commit is contained in:
@@ -5210,7 +5210,7 @@ namespace bimg
|
||||
|
||||
if (_imageContainer.m_ktx)
|
||||
{
|
||||
const uint32_t size = numSides == 6 ? mipSize : mipSize * numSides;
|
||||
const uint32_t size = _imageContainer.m_numLayers == 1 && _imageContainer.m_cubeMap ? mipSize : mipSize * numSides;
|
||||
uint32_t imageSize = bx::toHostEndian(*(const uint32_t*)&data[offset], _imageContainer.m_ktxLE);
|
||||
BX_ASSERT(size == imageSize, "KTX: Image size mismatch %d (expected %d).", size, imageSize);
|
||||
BX_UNUSED(size, imageSize);
|
||||
|
||||
Reference in New Issue
Block a user