BCPack: BC7 dictionary indices read as Microsoft's decoder reads them #1408
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1408
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@atk3001 on GitHub · 2026-11-28 19:15 UTC · original
atk3001:pr/bc7-dictionary→main· +10 −8 · 1 files · 1 commits · merged 2026-11-29 08:16 UTCWhat
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