fix(victory-gpu): preserve bytes outside texture readback regions #311
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!311
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-311"
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?
@mauroalvare on GitHub · 2026-11-26 02:15 UTC · original
mauroalvare:codex/victory-readback-region→main· +297 −53 · 4 files · 4 commits · openChange
In Neptune's D3D12
CopyTextureRegiontexture-to-buffer path, the GPU copied the requested box into staging. The deferred CPU copy then wrote every row of the destination footprint, including bytes outside the box. A 2×2 box read back into a 4×4 footprint overwrote adjacent title data even though the GPU copied the four requested texels correctly.Carry the region, row pitches and slice stride through the deferred copy. The title buffer receives only the rows and bytes written by the GPU, including when the destination has a nonzero origin. An omitted box uses the selected source mip's dimensions. This path is in
victory-gpu, whichtools/lancer_victory.ps1builds and launches.The region handling adapts Marvisak/VIctory
5cb63d8to Neptune's deferred readback and separate host and title pitches. The commit andTHIRD_PARTY.mdretain attribution. Microsoft'sCopyTextureRegioncontractVerification
Base
c4c93bdc413191a9dc909998d2d53080a3f0c880. Fix3f11d6cd59be6f7ccb5b2caa966cff338e05e764. Windows x64, Rust 1.98.1 MSVC, RTX 5070 Ti with driver 621.40 and Microsoft WARP.The minimal synthetic case uploads a 4×4 RGBA8 texture through the emulated command-list slot, then copies a 2×2 box to a title buffer filled with
0xcd. At the same 64-byte title pitch and 256-byte host pitch, base changed byte 520 from0xcdto0x00on both adapters. The same minimal case passed with the fix. The committed test also covers a nonzero destination origin and a whole source copied into a larger footprint. It compares all 4,096 bytes and passed on both adapters with 96 bytes copied and 4,000 unchanged. Neither focused run skipped.third_party/victorycargo test --locked --offline -p victory-gpu --lib --features diagnostics resource::tests::a_partial_texture_readback_preserves_unwritten_bytes -- --exact --nocapture --test-threads=1VICTORY_D3D12_WARP=1cargo test --locked --offline -p victory-gpu --lib --features diagnostics resource::tests::readback_layout_counts_block_rows_and_volume_slices -- --exactcargo test --locked --offline -p victory-gpu --lib --features diagnostics -- --test-threads=1cargo test --locked --offline -p victory-loader --test load_probecargo build --locked --offline --release -p victorycargo xtask policyThe three base failures are
spans_say_the_next_start_and_the_lowest_level_viewed,warp_card_fetch_copies_flagged_pieces_to_their_slots, andwarp_card_patch_writes_the_masked_bytes_and_no_others.From the repository root,
python -m pytest -rspassed 1,342 tests and skipped 323 that require built runtime or GPU artifacts absent from this checkout.python -m ruff check --select W605,F,E9 PrototypeScarlett tests toolspassed.Oracle and test data
The test computes the expected pixels and all untouched bytes from the original synthetic upload and the destination sentinel. The fixture uses small committed resources and holds them through submission and readback. All inputs are generated by the test.
Prepared with AI assistance (OpenAI Codex).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.