D3D12.X: CopyMemoryToMemoryX within one unified-memory window copies a buffer in COPY_DEST to itself (debug layer error 538) #958
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#958
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@fromthemoonx on GitHub · 2026-11-24 09:32 UTC · original
CopyMemoryToMemoryXwith its source and destination in the same unified-memory window copies inside one buffer while that buffer is inD3D12_RESOURCE_STATE_COPY_DEST. The D3D12 debug layer reports it as an error on every such copy, because a copy source must be inCOPY_SOURCE.Seen: on
main077ce40, in the e2e test title under the debug layer (e2e::test_title_draws_with_a_root_signature_under_the_debug_layer,XCL_D3D12_DEBUG=1),target/e2e-debug-layer/data/XCL.TestTitle/logs/xcl.log:It comes from the test title's
console_list_methods, which copies 64 bytes within its own graphics memory. That step makes noCopyBufferRegioncall of its own. The copy is XCL's translation inlist_x.rscopy_memory_x:The cross-window path transitions the source to
COPY_SOURCE; this one cannot, because one buffer cannot be inCOPY_SOURCEandCOPY_DESTat once.Effect: the bytes do arrive. The test title checks them (
CopyMemoryToMemoryXpasses), and so did the RTX 3060 here. So nothing is visibly wrong today. But it is a copy D3D12 does not define, so a driver may handle it differently, and it is an error in every debug-layer log of a title that copies within a window.Possible fix (not tried): copy through a scratch buffer, as #473 does for sources outside unified memory: first source range → scratch (
COPY_SOURCE→COPY_DEST), then scratch → destination range. Or, when the two ranges are in different placed resources of the window, use those.Also, the e2e debug-layer test only looks for "No root signature has been set". On
mainthe same log has 5 debug-layer errors: this one, three id 93 and one id 1046. The id 93 and 1046 errors come from the deliberately invalid console shaders inpso_capture_and_fallback/xbox_native_pso, and XCL falls back from them as intended. An allow-list of those ids would let the test catch new errors.Machine: RTX 3060 12 GB, driver 32.0.16.1088, Windows 11 26300, Graphics Tools (D3D12 SDK layers) installed, Rust 1.100.0 MSVC, debug.
Not tested: AMD; a retail title.
AI use: Claude Code (Claude Opus 5.5) ran the test, traced the message to
copy_memory_xand wrote this issue.@zohaiblazuli on GitHub · 2026-11-24 09:50 UTC · original
I'm working on this: CopyMemoryToMemoryX within one window will read its source through a second buffer placed on the same window heap (in COPY_SOURCE), so no buffer is in COPY_DEST and COPY_SOURCE at once. PR with a debug-layer test soon. (Claude Code, Claude Opus 5.5)