gpu(place): return placed copy buffers to COMMON after CopyBufferRegion #4590
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4590
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4589"
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?
@gnostic-snakes on GitHub · 2026-11-30 23:22 UTC · original
gnostic-snakes:fix/d3d12-placed-copy-barriers→main· +972 −849 · 33 files · 15 commits · closed without mergingFixes two D3D12 debug layer message 538 state mismatches observed in a 17-minute diagnostics run with VICTORY_D3D12_DEBUG=1 (RTX 5060 Ti 16 GB, driver 621.40, Windows 11 10.0.26200):
1. CopyBufferRegion source buffer left in COPY_DEST (0x400) (68,246 occurrences)
2. ExecuteCommandLists / SetComputeRootShaderResourceView seeing COPY_DEST (0x400) (98,637 occurrences)
Fix (crates/victory-gpu/src/host/place.rs)
Verification
@tyr0nsur on GitHub · 2026-11-30 23:44 UTC · original · reviewed
I checked the placed-copy state transitions with Claude. The source transitions need coverage for an already-promoted read state.
@ -654,0 +669,4 @@if let Some(from) = &own&& from.buffer.as_raw() != to.buffer.as_raw(){back.push(transition(&from.buffer, D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_COMMON));@tyr0nsur on GitHub · 2026-11-30 23:44 UTC · original · edited 2026-11-30 23:50 UTC
The new
COPY_SOURCE -> COMMONtransition assumes this shadow buffer has only been promoted toCOPY_SOURCE. A previous root SRV read of the same buffer can leaveNON_PIXEL_SHADER_RESOURCEin its promoted state, and the copy addsCOPY_SOURCEwithout clearing that bit. Then thisStateBeforeomits a valid read state. A buffer also retains its promotion across command lists in the sameExecuteCommandListscall. D3D12 promotion and decay rulesCould we exercise
root SRV read -> placed copyin one list with the debug layer? The existing placed-constant test starts with fresh shadows and exercises a scratch source, so it leaves this case uncovered. The same assumption is present in the new source resets inplace_constantandplace_source.Local check of
4bcfd16a: five placed-copy tests passed withVICTORY_NARROW_BARRIERS=0, including data readback; the benchmark was ignored. The installed runtime returnsDXGI_ERROR_SDK_COMPONENT_MISSINGforD3D12GetDebugInterface, so this run verifies functional output only. The promoted-SRV case still needs debug-layer coverage.@tyr0nsur on GitHub · 2026-12-01 01:05 UTC · original
I checked
18438462: the legacy copy now transitions the destination alone and leaves the source's promoted read bits intact. That addresses my earlier concern about the source'sStateBefore.The current branch still shows a merge conflict with
mainand inherited files in the PR diff. I applied only the final legacy barrier hunk to7d93ee07, keeping main's enhanced-barrier path.cargo test --locked -p victory-gpu --lib --features diagnostics host::place::tests::passed (5 passed, 1 benchmark ignored). This is functional coverage. This local run did not validate D3D12 debug messages on Intel.The new Arc B580 report #4643 has the same two ID 538 categories. With card-buffer copies disabled it still sees the copy-source error and a device hang, so the destination-state validation and the remaining hang need separate A/B results. A branch based on current main with this one hunk would make that comparison easier.
@eleboucher on GitHub · 2026-12-01 14:27 UTC · original
Tested on an RTX 4070 Ti SUPER (16 GB, 32 GB RAM), Series X, native 1440p, hardware RT on (main
5fabb46e+ #4694 #3067 #3063 #4171 #4760 #4338, then this PR's hunk cherry-picked unchanged). D3D12 debug layer on, 6-minute in-game leg each, same scene.So it removes most of what it targets. The two new kinds look like the edge cases #194 covers (a destination already moved out of COPY_DEST before the added transition). The new unit test
place_copy_leaves_its_destination_readable_in_the_same_executepasses on this card with the debug layer. No change in device losses either way in our runs; the global barrier after each placed copy already ordered the data, so this reads as a state-legality fix.@trustno1-coder on GitHub · 2026-12-01 18:36 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed