Repository navigation
GPU: read same-list GPU writes in placed buffer-to-texture copies - #1374
fuzeofficlal wants to merge 1 commit into
Conversation
|
I audited
Step 3 takes the The same thing can happen the other way, though it's less likely. Suggestion: track, per list, which shadow buffers are known to be in explicit AI-assisted review (Claude Code); checked on Windows 11 / RTX 5090. |
catminou4
left a comment
There was a problem hiding this comment.
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; this is source review of a large diff plus the PR's own Windows tests.
Placed buffer-to-texture copies now read same-list GPU writes: has_gpu_write/written_shadow walk the deferred Step::GpuWrite records backwards, require every requested range to be covered by writes into ONE shadow (Arc::ptr_eq, mixed shadows → None), subtract covered ranges, and only then fall back to CPU copies. The interval subtraction and the chosen-shadow consistency check are the right conservatism. 3 tests including a debug-layer guard. Please confirm on Windows that the placed-copy path actually hits this (the tests look host-gated).
|
Automated triage for the maintainers. Recommendation: merge candidate (rebased; reviewed again against current When the bytes a placed
CI Generated by Claude Code |
5dd1e71 to
64afee4
Compare
|
Rebased onto
|
64afee4 to
7593572
Compare
|
Pushed
|
…u-same-list-forwarding Loader, GPU: lazy NOP patching on #UD, BLAKE3 image caching, and same-list GPU placed copy forwarding (Marvisak#1372, Marvisak#1374)
Use the backing Shadow buffer in CopyTextureRegion when an earlier GPU command in the same command list produced every byte read by the placed footprint or source box without an intervening CPU write, rebasing unaligned placed offsets on the GPU while preserving box-relative offsets. Also forward guest CopyBufferRegion and buffer CopyResource on the GPU when their source range comes from an earlier GPU write in the same list, tracking explicit per-list UNORDERED_ACCESS buffer state across recorded shader writes, indirect execution (including separate count buffers), dropped draws or dispatches, command-list resets, and GPU copies while leaving deferred CPU snapshots intact otherwise. Closes Marvisak#785.
7593572 to
71f5dd7
Compare
|
Automated triage for the maintainers, second look (a review against current Closing because it is wrong against current If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution. |
Fixes #785.
Summary
CopyTextureRegionfootprint orpSrcBox(including pitched multi-row boxes and partial subsequent overwrites on the sameShadowbuffer) was produced on the GPU earlier in the same command list without an intervening CPU write (HostList::written_shadow+PlacedFootprint::box_reads).Shadowbuffer (UNORDERED_ACCESS -> COPY_SOURCE -> UNORDERED_ACCESS), or rebase non-512-byte-aligned placed offsets onto a temporary aligned host buffer on the GPU while preservingD3D12_BOX-relative byte offsets.CopyBufferRegionand bufferCopyResourceon the GPU when their source bytes come from an earlier GPU write in the same command list, keeping deferred CPU upload snapshots unchanged otherwise.Verification
box_readsand end-to-end synthetic GPU readback tests covering whole-texture copies,D3D12_BOXsub-box copies, unaligned placed offsets, pitched multi-row GPU writes, partial GPU overwrites, and chainedDispatch -> CopyBufferRegion -> CopyTextureRegion:VICTORY_D3D12_DEBUG=1): passed (0debug errors)VICTORY_D3D12_DEBUG=1): passed (0debug errors)VICTORY_D3D12_DEBUG=1): passed (0debug errors)cargo clippy --workspace --all-targets --all-featuresandcargo xtask policy: passed.