Skip to content

Commit e297a2f

Browse files
committed
Add specific Vulkan format handling for viking_room.ktx2 asset
- Ensure `viking_room.ktx2` uses `vk::Format::eR8G8B8A8Unorm` when detected. - Adjust logic to prioritize texture path check before KTX class ID validation.
1 parent 04b97eb commit e297a2f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

attachments/35_gltf_ktx.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,11 @@ class VulkanApplication {
796796
// Determine the Vulkan format from KTX format
797797
vk::Format textureFormat;
798798

799+
if (TEXTURE_PATH.find("viking_room.ktx2") != std::string::npos) {
800+
textureFormat = vk::Format::eR8G8B8A8Unorm;
801+
}
799802
// Check if the KTX texture has a format
800-
if (kTexture->classId == ktxTexture2_c) {
803+
else if (kTexture->classId == ktxTexture2_c) {
801804
// For KTX2 files, we can get the format directly
802805
ktxTexture2* ktx2 = reinterpret_cast<ktxTexture2*>(kTexture);
803806
textureFormat = static_cast<vk::Format>(ktx2->vkFormat);
1 MB
Binary file not shown.

0 commit comments

Comments
 (0)