Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Encode astc support #952

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wasimabbas-arm
Copy link
Contributor

@wasimabbas-arm wasimabbas-arm commented Oct 19, 2024

Updated version of #810.

Since #810 was adding a separate tool. Its easier to start another cleaner PR.

This PR has:
Commit to add --format option and make it exclusive with --codec
Add ASTC support to encode

Copy link
Collaborator

@MarkCallow MarkCallow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wasimabbas-arm. Can you now get metrics for ASTC compressed files?

You will need to add tests of the new functionality to the tools CTS and possibly need to update some existing tests.


ktx_error_code_e ec = KTX_SUCCESS;
// Decode the encoded texture to observe the compression losses
ec = ktxTexture2_TranscodeBasis(texture, KTX_TTF_RGBA32, 0);
if (isFormatAstc((VkFormat)texture->vkFormat))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can check the colorModel in the DFD to see if it is ASTC rather than the switch statement in isFormatAstc.

@@ -807,3 +890,232 @@ ktxTexture2_CompressAstc(ktxTexture2* This, ktx_uint32_t quality) {

return ktxTexture2_CompressAstcEx(This, &params);
}

struct decompression_workload
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like having the decoder in a file called astc_encode.cpp. I know we talked about this before but I don't recall the answer to "is there a lot of code in this file shared between encode and decode?" If not then I'd prefer the decoder in a separate file. If there is then consider renaming the file to astc_codec.cpp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants