GPU: texture to buffer copies (read back) #1952
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1954"
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 Marvisak/VIctory. Originally posted by RaghavVijayanand on 2026-11-25T01:45:10Z.
CopyTextureRegioninto a title buffer (a placed footprint) was dropped with a warning ("texture to buffer copies not implemented"), so anything a title read back from the GPU stayed stale.Shortcut, documented in the code: later GPU work in the same submission that reads that buffer sees its old bytes. Titles read back for the CPU, after a fence.
Tests:
resource::tests::texture_data_reaches_the_title_buffercopies a title buffer into a texture, then the texture into another title buffer at offset 64, through our list and queue.-D warnings, with and without--all-features.Imported from Marvisak/VIctory. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T01:45:17Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T01:54:27Z.
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at
9e0a2d1.victory-shader: 120 passed, 0 failed.victory-gpu: 51 passed, 0 failed. Note that the branch is based onffe310e, so these are that base's test sets, not currentmain's. A rebase would let it be checked againstmain's tests (and its NVIDIA heap-cap failures). Not run: a title.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T02:10:30Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Texture-to-buffer copies (read back…): copy path extension — pairs with #1816/#1869 copyback work.
Imported from Marvisak/VIctory. Originally posted by AlanQiang0418 on 2026-11-25T02:27:11Z.
Two disjoint readbacks into the same placed footprint can erase one another on
9e0a2d1. I used the existing 4×4 RGBA8 fixture, destination offset 64, row pitch 256, initialized to0xEE. In one command list I copied the left two columns and then the right two into their corresponding positions. After completion, row 0 beganEE EE EE EE EE EE EE EE 08 09 0A 0B 0C 0D 0E 0F; the expected bytes are00..0F. RTX 5080 and WARP reproduced it. Each copy prefilled a separate staging footprint from the same original buffer and then wrote the entire footprint back, so the second one restored the left half's old bytes.Follow-up commit with the fix and regression. It copies back only the row spans written by each command, in submission order; #137 also used row spans in its earlier partial-readback work. The fixture now checks all 2,048 destination bytes, covering the two writes, a whole-subresource copy at a second offset, padding and adjacent bytes. A separate arithmetic test covers BC1 blocks across two slices.
The
victory-gpudiagnostics library suite passed on RTX 5080 and WARP (55 passed, 1 ignored on each). GPU all-targets/all-features Clippy also passed. The BC1 case checks the span calculation; the device readback uses RGBA8.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T08:21:18Z.
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-gpu/src/host.rs,crates/victory-gpu/src/list.rs,crates/victory-gpu/src/resource.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (needs work) was for an older state ofmain.Generated by Claude Code
upstream-sync referenced this pull request2026-11-25 13:02:56 +00:00
Imported from Marvisak/VIctory. Originally posted by RaghavVijayanand on 2026-11-26T12:24:51Z.
Closing as superseded by
main.5cb63d8("GPU: texture to buffer copies read back into the title's buffer") does the same through readback memory, and it writes back only the rows each copy touched (footprint.rows(at, size)). So the overwrite between disjoint copies that @AlanQiang0418 found, and fixed in f114ee7, cannot happen there. Thanks for the careful repro and fix.Pull request closed