diff --git a/CMakeLists.txt b/CMakeLists.txt index 96dee7e63b..0dcacdbf0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -759,7 +759,7 @@ macro(common_libktx_settings target enable_write library_type) ${target} PRIVATE lib/basis_encode.cpp - lib/astc_encode.cpp + lib/astc_codec.cpp ${BASISU_ENCODER_C_SRC} ${BASISU_ENCODER_CXX_SRC} lib/writer1.c diff --git a/lib/astc_encode.cpp b/lib/astc_codec.cpp similarity index 100% rename from lib/astc_encode.cpp rename to lib/astc_codec.cpp diff --git a/tools/ktx/metrics_utils.h b/tools/ktx/metrics_utils.h index 04c1c94b9c..e5e7677244 100644 --- a/tools/ktx/metrics_utils.h +++ b/tools/ktx/metrics_utils.h @@ -107,8 +107,10 @@ class MetricsCalculator { tSwizzleInfo.swizzle = "rgba"; ktx_error_code_e ec = KTX_SUCCESS; + // Decode the encoded texture to observe the compression losses - if (isFormatAstc((VkFormat)texture->vkFormat)) + const auto* bdfd = texture->pDfd + 1; + if (khr_df_model_e(KHR_DFDVAL(bdfd, MODEL)) == KHR_DF_MODEL_ASTC) { ec = ktxTexture2_DecodeAstc(texture, VK_FORMAT_R8G8B8A8_UNORM); }