BCPack: BC7 dictionary indices read as Microsoft's decoder reads them #1408
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1408"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by atk3001 on 2026-11-28T19:15:22Z.
What
Each BC7 dictionary entry in the BCPack tables stores its two index widths and then the indices. Microsoft's decoder (BCPack.dll) does not skip the word after the widths. In every entry but the first, that word is the widths again, and the decoder takes it as pixel 0's index. So the stored indices land one pixel later than we placed them, and the last one spills into set 1, which no entry uses (0 index bits).
Our reader skipped that word and filled 31 slots, so every pixel of a dictionary-coded BC7 block took its neighbour's index.
Tables::bc7: all 32 slots are read in order, pixel 0 included.bc7_dictionary_indices_line_upnow checks the layout the decoder uses: pixel 0 equals the widths word in entries after the first, and set 1 has no index bits.Tests
victory-formatslib: 46 passed. Clippy is clean.Overlap
🤖 Generated with Claude Code