Skip to content

Commit c16537c

Browse files
committed
Fix ktxTexture2_DecodeAstc documentation.
1 parent d1ad5cd commit c16537c

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

cmake/docs.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function( CreateDocLibKTX )
126126
libktx.doc
127127
lib/libktx_mainpage.md
128128
include
129-
lib/astc_encode.cpp
129+
lib/astc_codec.cpp
130130
lib/basis_encode.cpp
131131
lib/basis_transcode.cpp
132132
lib/miniz_wrapper.cpp

lib/astc_codec.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ compressionWorkloadRunner(int threadCount, int threadId, void* payload) {
512512
}
513513

514514
/**
515+
* @internal
515516
* @brief Worker thread helper payload for launchThreads.
516517
*/
517518
struct LaunchDesc {
@@ -528,6 +529,7 @@ struct LaunchDesc {
528529
};
529530

530531
/**
532+
* @internal
531533
* @brief Helper function to translate thread entry points.
532534
*
533535
* Convert a (void*) thread entry to an (int, void*) thread entry, where the
@@ -902,6 +904,7 @@ struct decompression_workload
902904
};
903905

904906
/**
907+
* @internal
905908
* @brief Runner callback function for a decompression worker thread.
906909
*
907910
* @param thread_count The number of threads in the worker pool.
@@ -923,19 +926,20 @@ static void decompression_workload_runner(int thread_count, int thread_id, void*
923926
}
924927

925928
/**
926-
* @brief Decodes the provided ktx2 texture if its astc encoded
929+
* @ingroup reader
930+
* @brief Decodes a ktx2 texture object, if it is ASTC encoded.
931+
*
932+
* Updates @p This with the decoded image.
927933
*
928934
* @param This The texture to decode
929935
* @param vkformat The decoding format to use
930936
*/
931-
// will update "This" with the uncompressed copy
932-
KTX_API KTX_error_code KTX_APIENTRY
937+
KTX_error_code
933938
ktxTexture2_DecodeAstc(ktxTexture2 *This, ktx_uint32_t vkformat) {
934939
// Decompress This using astc-decoder
935940
uint32_t* BDB = This->pDfd + 1;
936941
khr_df_model_e colorModel = (khr_df_model_e)KHR_DFDVAL(BDB, MODEL);
937-
if (colorModel != KHR_DF_MODEL_ASTC && This->supercompressionScheme != KTX_SS_NONE) // No supercompression supported yet
938-
{
942+
if (colorModel != KHR_DF_MODEL_ASTC) {
939943
return KTX_INVALID_OPERATION; // Not in valid astc decodable format
940944
}
941945

@@ -1008,7 +1012,7 @@ ktxTexture2_DecodeAstc(ktxTexture2 *This, ktx_uint32_t vkformat) {
10081012

10091013
// if(params->perceptual) flags |= ASTCENC_FLG_USE_PERCEPTUAL;
10101014

1011-
uint32_t threadCount{1}; // Decompression isn't the bottlneck and only used when checking for psnr and ssim
1015+
uint32_t threadCount{1}; // Decompression isn't the bottleneck and only used when checking for psnr and ssim
10121016
astcenc_config astc_config;
10131017
astcenc_context *astc_context;
10141018
astcenc_error astc_error = astcenc_config_init(profile,

0 commit comments

Comments
 (0)