GPU: texture to buffer copies (read back) #1954
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1954
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@RaghavVijayanand on GitHub · 2026-11-25 01:45 UTC · original
RaghavVijayanand:gpu/texture-readback→main· +228 −4 · 3 files · 1 commits · closed without mergingCopyTextureRegioninto 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.@upipibi on GitHub · 2026-11-25 01:54 UTC · original
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).
@AlanQiang0418 on GitHub · 2026-11-25 02:27 UTC · original
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.@Marvisak on GitHub · 2026-11-25 08:21 UTC · original · edited 2026-11-25 16:02 UTC
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
@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 01:45 UTC · original · reviewed
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.
@catminou4 on GitHub · 2026-11-25 02:10 UTC · original · reviewed
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.
@RaghavVijayanand on GitHub · 2026-11-26 12:24 UTC · original
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