D3D12.X: a capture copies the textures its call reads #2431
No reviewers
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!2431
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2431"
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?
@madaraXor on GitHub · 2026-11-25 18:38 UTC · original
madaraXor:capture-textures→main· +1630 −1 · 9 files · 3 commits · openThe textures of a captured call get their contents: each is copied on the GPU where the call stands and read back after the submit. Part of #675.
A copy recorded on the title's list sees the uploads of title memory that submit makes and what earlier commands of the list wrote; a read at record time or after the submit would not.
Stacked on #2430; only the top commit belongs here.
What is in it
hle/d3d12x/capture/textures.rs:copy_allrecords aCopyResourceof each texture into a texture of XCL's own on the list at the call;read_backcopies them to read-back buffers on a queue of XCL's own once the title's queue is past the list, and writestex_<id>.bin(all subresources and planes in the layout ofGetCopyableFootprints).capture.rs,real.rs: the two calls.partial:) is not copied and goes intoleft_out, so noALL_SUBRESOURCEStransition is made from a state some subresource is not in (copyable). Test:a_texture_in_no_one_state_is_not_copied.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on5f8eb9c: 1430 passed, 6 failed, 46 ignored. The failures:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 540),hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory(#650) and the e2e teststest_title_runs_and_game_folder_is_untouched,test_title_draws_with_a_root_signature_under_the_debug_layerandtest_title_runs_under_the_debug_layer_with_dred, which fail onmaine1d84b7on this machine too (its whole suite: 1416 passed, 7 failed, 46 ignored);hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memoryfailed in this whole-suite run; it fails in the whole-suite run ofmaine1d84b7on this machine too. SKIPPED: the six per-lane cases off16_programs_on_the_gpu/f32_programs_on_the_gpu(refused),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)Regression run
scripts/smoke.ps1, 60 s, release builds, the same title on the same day.main:
PR:
Not tested
XCL_CAPTURE_MAX_MB.AI use
🤖 Generated with Claude Code
@emirduran707 on GitHub · 2026-11-25 19:27 UTC · original
Independent AMD RDNA4 (native wave64) test report on exact head
20059ab65622734ccf48be4edc99aa8633caca29(clean detached checkout, no local changes).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1271 passed, 2 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpurefused by per-lane form;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record). All 8hle::d3d12x::capturetests (includingcapture::textures::tests::a_copy_holds_every_subresource_and_plane) passed.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed 722 andfuzz_validate_and_gpu_3seed 1599) are pre-existing on unmodifiedmainon this GPU.Regression run (60 s retail-title smoke,
XCL_NETWORK=0, release; default capture off)(Matched
main68a284abaseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
XCL_CAPTURE_DRAWcapture on the retail title; D3D12 debug layer; Intel GPUs.AI use
@SlopTart on GitHub · 2026-11-25 19:46 UTC · original
gpu_suite (cold cache): 160 passed / 4 failed, no crashes. Three are the known baseline trio on this lane; the fourth isgpu_promoted_uav_clear_values_pass_create_committed_resource, newly red on main since #2280 (report), unrelated to this PR.Targeted run of the capture tests: 8 passed.
@DavidM1911 on GitHub · 2026-11-25 20:04 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
@madaraXor on GitHub · 2026-11-25 23:43 UTC · original
Thanks, fixed, with #2430's per-subresource tracking.
copy_allno longer copies a texture whose subresources are not in one known state (copyable). It goes intoleft_outwith the reason, sosnapshotnever issues anALL_SUBRESOURCEStransition from a state some subresource is not in.a_texture_in_no_one_state_is_not_copied.@upipibi on GitHub · 2026-11-25 23:59 UTC · original
NVIDIA test report for
c01c55b(this branch contains #2430's headf6354cd): RTX 3070 8 GB (Ampere, driver 616.56), Windows 11 26100, Rust 1.100.0, debug.cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4(thehle::xaudio2tests hang on this machine, onmaintoo):c01c55b: 1301 passed, 0 failed, 26 ignored.mainat08db802: 1295 passed, 0 failed, 27 ignored.SKIPPEDlines on both sides (no wave64 etc.).Lib tests only; no title run.
AI-assisted (Claude Code, Claude Opus 5.5).
@DavidM1911 on GitHub · 2026-11-26 02:12 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
c01c55bd0eto5f8eb9cd7a@bmjask on GitHub · 2026-11-25 20:53 UTC · original · reviewed
Blocked by the P1 per-subresource state flaw introduced in #2430. state_of records one state per resource, then textures::snapshot transitions ALL_SUBRESOURCES through COPY_SOURCE and back using that one StateBefore. A valid partial mip/slice transition can thus make capture declare wrong states for every other subresource, causing debug-layer errors/undefined GPU state when enabled. Track per-subresource states or skip textures with unknown partial state; add a partial-state capture test. Other copy lifetime/queue ordering looked sound, but this stacked PR also lacks a clean suite/current broad validation.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.