BCPack: BC7 channel rotation is applied in every mode, not just 4 and 5 (wrong-coloured 4x4 blocks on textures) #411
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX#411
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Jesper-Andersson on GitHub · 2026-11-27 01:14 UTC · original
Environment
avatarmanz/VIctory-7900XTX@014d52d(main at the time of the runs), plus #203 (DLSS) and pr0vId3nce/VIctory-NVIDIA's own-bytes pool (67a50c6,835d4e8) in the test buildvictory run <title> --execute --console series-swithscripts\play.ps1's settings plusVICTORY_CARD_BUFFERS_MIN_KB=64,VICTORY_CARD_BUFFERS_MB=1024,VICTORY_RESIDENCY=1,VICTORY_WIDE_MERGE=1,VICTORY_WINDOW_KB=1024,VICTORY_SUBMIT_FRAMES=2,VICTORY_CARD_ROOM_FOR_TARGETS_MB=1280What happens
Indoors early in the game, the clothing of the characters is covered in a mosaic of small square blocks in the wrong colours: each block looks like a plausible piece of texture, but neighbouring blocks don't match. Reproducible on this build.
crates/victory-formats/src/bcpack.rs:bc7_precision()(line 749) andbc7_pack()(line 855) readctrl >> 3 & 3as a channel rotation for every BC7 mode. Only modes 4 and 5 have a rotation field. For the other modes those bits rotate channels that have no rotation: modes 0, 1 and 3 with rotation 1 panic on a shift (red's precision becomes 0), modes 0-3 with rotation 2 or 3 drop a colour channel, and modes 6 and 7 skip red's p-bit and pack the endpoints out of order. That gives wrong colours per 4x4 block.Narrowed down
Same build and settings, one change, one run each:
bc7_precisionMarvisak/VIctory#3111 (by RVZO6, open) has this fix with a regression test that panics on main without it. fxceless/victory-fork (
06702fe), ExoCalibra/victory-exo (c1ce2fad) and pr0vId3nce/VIctory-NVIDIA (41791231, via Marvisak#3386) carry it. A PR porting #3111 follows.Log
No log line names it: the decode doesn't fail, it decodes the wrong colours.
Not checked
AMD; Series X; a build without the own-bytes pool (the fix is in the format decoder, which the pool doesn't touch).
AI use
Code reading and write-up with AI assistance (Claude Code); the runs are my own.