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

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

Description

@GregSlazinski

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));
            }                

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions