[fork review] Fix SGD image desc indexing for 3D UASTC HDR 6x6i textures - #1
Closed
SashaRX wants to merge 1 commit into
Closed
[fork review] Fix SGD image desc indexing for 3D UASTC HDR 6x6i textures#1SashaRX wants to merge 1 commit into
SashaRX wants to merge 1 commit into
Conversation
The encoder writes the ktxUASTCHDR6x6IntermediateImageDesc table in level order, level 0 first, with each level contributing numLayers * numFaces * depth(level) image descriptions. The transcoder indexed it with level * levelImageCount + image using the current level's image count, which only matches that layout while every level has the same image count. For 3D textures depth halves with each level, so wrong descriptions - whose slice offsets are relative to a different level's data - were used and transcoding failed (or could read wrong slices). Accumulate per-level first-image indices instead, as transcodeEtc1s already does with its firstImages table. Since firstImages[numLevels] is the image count implied by the texture's dimensions, also validate the descriptor table size up front: a table that is not exactly that many descriptions, or not a whole number of them, is rejected with KTX_FILE_DATA_ERROR before any level is processed. Encoding a 24x24x8 3D texture with 4 mip levels to UASTC HDR 6x6 intermediate and transcoding it to ASTC_HDR_6x6_RGBA failed with KTX_TRANSCODE_FAILED before this change and succeeds after it; a 2D texture with identical parameters passes both before and after. Both cases are added to transcodetests as generated round-trip tests with no new binary test resources. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TwbY1ssonXWLySoLyErf2W
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Internal review copy — do not merge.
Mirror of KhronosGroup#1237, opened inside the fork to run automated review without adding noise to the upstream thread. Will be closed after review; the upstream PR is the real one.
See the upstream PR for the full description. Summary:
transcodeUastcHDR6x6_intermediateindexed the SGD image description table withlevel * levelImageCount + image, which diverges from the level-ordered cumulative layout the encoder writes when levels have different image counts (3D textures). Fix accumulates per-level first-image indices, validates the table size up front (KTX_FILE_DATA_ERROR), and adds generated 2D/3D round-trip regression tests.🤖 Generated with Claude Code
https://claude.ai/code/session_01TwbY1ssonXWLySoLyErf2W
Generated by Claude Code