Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

if programCount==1 then ASTC compression fails (PURPLE color) #34

Open
GregSlazinski opened this issue May 12, 2022 · 0 comments
Open

Comments

@GregSlazinski
Copy link

GregSlazinski commented May 12, 2022

I'm porting the code to use in regular C++, so it can be compiled on other platforms without ISPC compiler.
And I've noticed that ASTC compression always fails if programCount==1 (PURPLE color)
programCount>=2 work OK.
Looks like your codes have some assumption that programCount>=2, and in other cases they don't work.
Could you please check?

The simplest solution was to do:

#define programIndex 0
#define programCount 1

But that didn't work (PURPLE color), so I had to do for example this, with programCount>=2 :

for(int programIndex=0; programIndex<programCount; programIndex++)
    ispc::astc_encode_ispc((ispc::rgba_surface*)src, block_scores, dst, list, &list_context, (ispc::astc_enc_settings*)settings, programIndex);

Then it worked.

Maybe this code has something to do with it:

            if (*mode_list < programCount - 1)
            {
                int index = int(mode_list[0] + 1);
                mode_list[0] = index;

                mode_list[index] = (uint64_t(offset) << 32) + mode;
            }
            else
            {
                mode_list[0] = (uint64_t(offset) << 32) + mode;

                astc_encode(src, block_scores.data(), dst, mode_list, settings);
                memset(mode_list, 0, list_size * sizeof(uint64_t));
            }                

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

No branches or pull requests

1 participant