Skip to content

Commit 7a2283b

Browse files
authored
Merge pull request #758 from CesiumGS/fix-mipmap-textures
Fix loading KTX2 textures with mipmaps
2 parents 5b5419d + cc98719 commit 7a2283b

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ jobs:
138138
if: ${{ runner.os == 'Linux' && matrix.config.name != 'AlmaLinux 8 - GCC' }}
139139
run: |
140140
sudo apt update
141-
sudo apt install -y doxygen clang-tidy-15 gcovr
141+
sudo apt install -y doxygen clang-tidy-15 clang-format-15 gcovr
142+
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-15 100
143+
sudo update-alternatives --set clang-format /usr/bin/clang-format-15
142144
sudo pip3 install conan==1.63.0 black==23.1.0 flake8==7.1.1 --ignore-installed
143145
144146
# Could not figure out how to add Chocolatey libraries to the PATH automatically with refreshenv, so
@@ -151,6 +153,7 @@ jobs:
151153
run: |
152154
choco install -y conan --version 1.63.0
153155
choco install -y llvm --version=15.0.7 --allow-downgrade
156+
echo "C:/Program Files/LLVM/bin" >> $env:GITHUB_PATH
154157
pip3 install black==23.1.0 flake8==7.1.1 requests
155158
echo "C:/Program Files/conan/conan" >> $env:GITHUB_PATH
156159

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
### v0.25.0 - 2025-12-19
4+
5+
* Fixed loading KTX2 textures with mipmaps.
6+
37
### v0.25.0 - 2025-04-01
48

59
* **Breaking change:** Cesium for Omniverse now requires Kit 106.5 or above (Isaac Sim 4.5.0 or above).

src/core/src/FabricTexture.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,15 @@ void FabricTexture::setImage(const CesiumGltf::ImageCesium& image, TransferFunct
119119
} else {
120120
// As of Kit 105.1, omni::ui::kAutoCalculateStride doesn't work for compressed textures. This value somehow works.
121121
const auto stride = isCompressed ? 4ULL * static_cast<uint64_t>(image.width) : omni::ui::kAutoCalculateStride;
122-
const auto data = reinterpret_cast<const uint8_t*>(image.pixelData.data());
122+
auto data = reinterpret_cast<const uint8_t*>(image.pixelData.data());
123123
const auto dimensions = carb::Uint2{static_cast<uint32_t>(image.width), static_cast<uint32_t>(image.height)};
124124

125+
if (!image.mipPositions.empty()) {
126+
// Just set the first mip level for now
127+
// Later, investigate using setMipMappedBytesData
128+
data = data + image.mipPositions[0].byteOffset;
129+
}
130+
125131
_pTexture->setBytesData(data, dimensions, stride, imageFormat);
126132
}
127133
}

vcpkg/ports/ktx/portfile.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
vcpkg_from_github(
22
OUT_SOURCE_PATH SOURCE_PATH
33
REPO KhronosGroup/KTX-Software
4-
REF "v${VERSION}"
4+
REF "refs/tags/v${VERSION}"
55
SHA512 5a89f8986464705ec36ac1becaddd0ff335e4c3c235468aaef0e963fcfeda4c0d669a086b91e61c16a3ae9e1fa5bf456dccf12cc65720e1a22e7cc0f30552541
66
HEAD_REF master
77
PATCHES

0 commit comments

Comments
 (0)