Add ASTC texture transcoding setting for the Gamenative wrapper - #734
Merged
maxjivi05 merged 3 commits intoSep 11, 2026
Conversation
The bundled wrapper-gamenative libvulkan_wrapper.so already implements a BCn -> ASTC transcode path, but nothing in the app ever set WRAPPER_BCN_ASTC. The wrapper defaults that variable to enabled, so the transcoder ran implicitly at 8x8 with no way to see or control it, surfaced only as a "BCn Quality" low/high dropdown that never named what it did. Replace that dropdown with an explicit ASTC Transcoding control offering off / 4x4 / 8x8, defaulting to off. It lives in graphicsDriverConfig, so it inherits from the container and is overridable per shortcut like every other graphics key. The control is shown only when Wrapper-Gamenative is selected, the only wrapper that implements the path. The wrapper selects its block size with strstr(env, "8x8"), so the block size is passed through verbatim and the entries are limited to the two sizes the binary can honour. That parse has no error path: any value not containing "8x8" silently yields 4x4, so offering a size the wrapper cannot produce would report one block size and apply another. BC4, BC5 and BC6H never reach the ASTC path and still decompress to uncompressed formats, and the path itself only runs when BCn emulation is full or auto.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Community feedback on the first pass: "4x4" and "8x8" mean nothing to someone who doesn't already know what ASTC is. Name the options for what they do instead. The dropdown now reads Off / Fidelity / Performance. Block size is still what gets stored and what reaches the wrapper, so the runtime mapping is unchanged: Fidelity is 4x4, Performance is 8x8. Display labels and stored values are now separate arrays selected by index. parseIdentifier lowercases and hyphenates ASCII, so it cannot recover a stable value from a translated label, which is why the existing option arrays are untranslated identifiers. Splitting them lets the labels be translated into all 23 locales while astcTranscoding keeps storing 4x4 and 8x8. The two arrays must stay index-aligned; all 23 locales carry exactly three entries in the same order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bundled wrapper-gamenative libvulkan_wrapper.so already implements a BCn -> ASTC transcode path, but nothing in the app ever set WRAPPER_BCN_ASTC. The wrapper defaults that variable to enabled, so the transcoder ran implicitly at 8x8 with no way to see or control it, surfaced only as a "BCn Quality" low/high dropdown that never named what it did.
Replace that dropdown with an explicit ASTC Transcoding control offering off / 4x4 / 8x8, defaulting to off. It lives in graphicsDriverConfig, so it inherits from the container and is overridable per shortcut like every other graphics key. The control is shown only when Wrapper-Gamenative is selected, the only wrapper that implements the path.
The wrapper selects its block size with strstr(env, "8x8"), so the block size is passed through verbatim and the entries are limited to the two sizes the binary can honour. That parse has no error path: any value not containing "8x8" silently yields 4x4, so offering a size the wrapper cannot produce would report one block size and apply another.
BC4, BC5 and BC6H never reach the ASTC path and still decompress to uncompressed formats, and the path itself only runs when BCn emulation is full or auto.