From ddbeeae05779f84f97694553eb41605a60f86f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 5 Sep 2026 02:02:53 +0000 Subject: [PATCH] KTX/KTX2: Use zero depth to mean not a volume texture. (#151) --- src/image.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/image.cpp b/src/image.cpp index e6f903a..5aa3126 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -4619,7 +4619,7 @@ namespace bimg _imageContainer.m_offset = (uint32_t)offset; _imageContainer.m_width = width; _imageContainer.m_height = height; - _imageContainer.m_depth = depth; + _imageContainer.m_depth = 1 < depth ? depth : 0; _imageContainer.m_format = format; _imageContainer.m_orientation = Orientation::R0; _imageContainer.m_numLayers = uint16_t(bx::max(numberOfArrayElements, 1) ); @@ -5145,7 +5145,7 @@ namespace bimg _imageContainer.m_offset = uint32_t(levels[numMips - 1].byteOffset); _imageContainer.m_width = width; _imageContainer.m_height = height; - _imageContainer.m_depth = depth; + _imageContainer.m_depth = 1 < depth ? depth : 0; _imageContainer.m_format = format; _imageContainer.m_orientation = Orientation::R0; _imageContainer.m_numLayers = uint16_t(numLayers);