Skip to content

Option to specify ASTC encode quality & codec parallelism #341

Closed

Description

@mos9527

The current implementation hardcodes the quality level to 100 (exhaustive) which can be very slow. An option to somehow change this would be very helpful.

Moreover, it seems like the codec's threads option has never been set by UnityPy and is defaulted to 1. The optional set-to-0 for std::thread::hardware_concurrency is currently undocumented. Maybe this could be chosen as the default instead?

Activity

  1. K0lb3 commented on Aug 21, 2025

    @K0lb3
    Owner

    I guess that the quality level, among other settings, could be added to the UnityPy config.

    The threads setting is a bit tricky.
    I set it to 1 on purpose as I would expect heavy users to use mutli-threading or multi-processing with python,
    multiple threads in astc wouldn't make sense in such cases.
    But well, this can also simply be added to the config.

  2. mos9527 commented on Aug 22, 2025

    @mos9527
    ContributorAuthor

    I set it to 1 on purpose as I would expect heavy users to use mutli-threading or multi-processing with python,
    multiple threads in astc wouldn't make sense in such cases.

    This will still benefit single, heavy (large texture/block size/encode quality) workloads regardless though. On the other hand for single-threaded scripts, I suppose such 'free performance' coming from by-default parallelism is always a good-to-have without introducing the complexities of manually managing MT/MP workload.

    ...mutli-threading

    On that note, the current codec implementation prevents thread-level concurrency (multiple codecs) as the context-per-block size is always guarded by a single lock despite the codec's MT support. The following PR should address this:

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions