Skip to content

Commit

Permalink
Rename astc_encode.cpp to astc_codec.cpp, use dfd model to query for …
Browse files Browse the repository at this point in the history
…ASTC
  • Loading branch information
wasimabbas-arm committed Nov 13, 2024
1 parent 4faf9ea commit 8f4b5a6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion tools/ktx/metrics_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8f4b5a6

Please sign in to comment.