formats, texture: BC7 dictionary indices as BCPack.dll reads them; GPU copies reach views placed before them #67
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!67
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-67"
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?
@psychonaut0 on GitHub · 2026-12-01 12:35 UTC · original
psychonaut0:bc7-dictionary-placed-copied→main· +746 −7 · 5 files · 2 commits · closed without mergingTwo fixes from our fork (a Strix Halo / Radeon 8060S tree, Proton Experimental, RADV 26.3.1) that this tree lacks. One commit each, so either can be taken alone.
1. BC7 dictionary indices as BCPack.dll reads them (
VICTORY_BC7_DICTIONARY, on by default)Cause
Each BC7 entry of the BCPack table file has two width bytes, then 32 words. BCPack.dll takes all 32 as the entry's indices, pixel 0 first. In entries 1–254 that first word repeats the widths, and
Tables::parsetook it for padding: it skipped it and read 31. So every index of those entries landed one pixel early, and so did every block predicted from them, directly or through the history. Entry 0 was already read with all 32.Checked against BCPack.dll by trustno1-coder/VIctory-NVIDIA f9de61c5 and ubiquitarianism/leonida b589e0fe: 2,101,646 of the title's 2,866,176 BC7 blocks differed before, none after.
Change
crates/victory-formats/src/bcpack.rs: every entry reads 32 words.VICTORY_BC7_DICTIONARY=0restores the old reading.bc7_dictionary_indices_line_upasserted that a set with 0 index bits holds nothing. With 32 words, 233 of 254 entries put their last word in set 1's slot 0. No entry gives set 1 any bits, and that slot never reaches a block: the decoder skips 0-bit sets, andadd_indexdrops 0-bit reference indices. The test now asserts that. Its anchor check is unchanged and passes.2. A GPU copy into a texture also reaches the views placed over it before (
VICTORY_PLACED_COPIED=1, off by default)Cause
The decoration bake copies its result (make-up, stubble, tattoos, prints and numbers on clothes) into a block-compressed texture. The title then samples it through a view placed at the same address, often in another block format, e.g. a BC3 texture written and a BC7 view sampled. On the console those are the same bytes. Here the view gets its own texture (
resource::texture_at), filled from title memory, which the host's copy never reaches. Where the bake's result belongs, the view shows zeros, or whatever was in that memory before, for as long as it lives.alias_ofdoes not cover this case: it pairs views only with render/UAV targets of the same levels.Change
With the switch:
CopyTextureRegion/CopyResourceinto a title texture is repeated, through a buffer, into the textures of the views placed over it that are laid out alike (resource::placed_twins: same dimension, size and layers, blocks of the same size, no more levels).placed_twinsis empty and nothing changes.Not covered:
seed_later).twin_copyshould note its writes the same way (note_gpu_written).Testing
VICTORY_BC7_DICTIONARY=0. New testbc7_dictionary_entries_read_as_bcpack_dll_reads_themparses the shipped table both ways.--lib(diagnostics, Proton Experimental, Radeon 8060S): 309 passed, withVICTORY_PLACED_COPIEDoff and on. The same 11 failures, and the crash indescriptor::tests::views_die_with_their_resource, happen on37bb30funchanged.placed_copied_card(ignored, needs a GPU): a one-level BC7 sRGB view placed over a two-level BC7 texture before a title list copies into it. Read back, it printsplaced copied: the view placed before the copy holds its blocks with the switch, not without.Origin
aliasdoes.A third fix of ours, mesh records
(n, 0, 0)run as(n, 1, 1)(VICTORY_MESH_ONE_DIM), is already open here as #45, so it is not repeated.@BlueCatsz on GitHub · 2026-12-01 16:03 UTC · original
Tested #67 (
VICTORY_BC7_DICTIONARYdefault on +VICTORY_PLACED_COPIED=1) on CachyOS + RX 9070 XT 16 GB as part of a combined local stack (main37bb30f+ #44 + #47 + #67 + #31 + #43 + opt-inVICTORY_AMBIENT_RT, withVICTORY_POOL_MOVE=1).26.3.1+ #44/#43mesa.patch), CachyOS (kernel7.3.6),proton-cachyos-slr+ RB-treewineserver, Series X (1706x960 -> 2560x1440, HW RT on, FG off).37bb30f + #44was gone (0crashes,0device loss,0dropped draws). (Note: tested together with #47 rather than isolated.)@Luxuride on GitHub · 2026-12-04 12:03 UTC · original · edited 2026-12-05 11:24 UTC
As I read it, this is already in
main: both halves are in main.9268924is patch-identical to main'sb73c5c5, and4c78099was cherry-picked as914276d— whose message still records(cherry picked from commit 4c78099…).Main documents the result too:
crates/victory-formats/src/bcpack.rs:88-92explainsVICTORY_BC7_DICTIONARY=0, with the testbc7_dictionary_entries_read_as_bcpack_dll_reads_thematbcpack.rs:1737, andVICTORY_PLACED_COPIEDis indocs/SETTINGS.mdandrun.conf.default.One hole main inherited and never closed, which is worth an issue of its own:
VICTORY_BC7_DICTIONARYis documented only in code comments, not indocs/SETTINGS.mdorrun.conf.default— the same asVICTORY_ARROWS_DPAD,VICTORY_AMBIENT_MOSTandVICTORY_PLANES. That is a main task, not something this branch can fix.Whether it still has work of its own is the maintainer's call, not mine.
Pull request closed