Repository navigation
Conversation
This was referenced Nov 26, 2026
… readback_copy With XCL_FRAME_DUMP set and no composited present, the frame dump recorded a texture copy from the title's own resource at present time. XCL does not know which state the title keeps that resource in, and readback_copy recorded the copy for any resource, a buffer included (xcl-dev#499, observation 2: an access violation in the NVIDIA user-mode driver at ~250 presents, only with the dump on). The dump now reads back the swap chain buffer XCL has just copied into, as the composited path already does, through dump_backbuffer, which moves the buffer to COPY_SOURCE and leaves it in PRESENT. readback_copy refuses anything other than a single-sample 2D texture with a size and a footprint format, and a failed GetCopyableFootprints (readback_possible). Tests: readback_possible's cases, and a WARP test that dumps a filled swap chain buffer from COPY_DEST, reads the pixels back and refuses a buffer (it fails without the guard: the old readback_copy returned a copy for it). Assisted-by: OpenCode (Claude Opus 5.5) Assisted-by: Google Antigravity CLI (Gemini 4 Hydrogen (High))
itsSio
force-pushed
the
d3d12x/frame-dump-swapchain-readback
branch
from
November 26, 2026 12:08
b25ae0c to
6d29dc2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
XCL_FRAME_DUMPset and no composited present, the frame dump read back the title's ownsrcwith a texture copy recorded at present time. XCL does not know which state the title keepssrcin, andreadback_copyrecorded the copy for any resource, buffers included. The dump now reads back the swap chain buffer XCL has just copied into (COPY_DEST -> COPY_SOURCE -> PRESENT), as the composited path already does from RENDER_TARGET, andreadback_copyrefuses what it cannot copy to a buffer: anything other than a single-sample 2D texture with a size and a footprint format, or a failedGetCopyableFootprints. Part of xcl-dev#499 (observation 2).What is in it
D3D12.X: read back the swap chain buffer for the frame dump and guard readback_copy:crates/xcl/src/hle/d3d12x/present.rs(dump_backbufferused by both present paths;readback_possiblechecked inreadback_copy; a unit test of the checks and a GPU test on WARP that dumps a filled swap chain buffer and refuses a buffer)Tested
Commit
b25ae0cf3816b2538742645b755ea8cf967976fd, clean checkouts on each PC, debug builds for workspace tests and release builds for retail smoke runs.32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200, Rust 1.97.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5.cargo build --workspace: exit 0.cargo test --workspace -- --test-threads=4: 1431 passed, 0 failed, 47 ignored.SKIPPEDGPU tests: wave64 tests (no wave64 on this adapter), f16 / f16-conversion wave32 refusals (#1426),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(driver cache, Developer Mode).cargo test -p xcl --lib frame_dump_tests: 5 passed, 0 failed, 0 ignored. With thereadback_copycheck removed, the new test fails on the buffer assertion.XCL_FRAME_DUMP=1+XCL_PRESS_A_AT=15,25,35,45,55check (release, RTX 5080): bothmain08db8020(3258frames, non-black fromframe_2780at ~105 s) andb25ae0cf(3306frames, non-black fromframe_2300at ~89 s) capture genuine non-black BMPs (max=249,mean=36.6,99.8%non-dark) with0crashes,0device removals, and0nvwgf2umx.dllfaults.32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200, Rust 1.99.1 (stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC 1.8.2502.11.cargo build --workspace: exit 0.cargo test --workspace -- --test-threads=4: first run had 1 unrelated failure (vfs_hooks::tests::move_with_locked_overlay_source_preserves_destination). Rerun with--no-fail-fast: 1431 passed, 0 failed, 47 ignored; that test passed 10/10 standalone.SKIPPED: the same 26, plusuploads_start_from_each_subresources_state(no D3D12 debug layer).cargo test -p xcl --lib frame_dump_tests: 5 passed, 0 failed, 0 ignored.present.rsGPU tests run on WARP.Regression run
main(08db8020, RTX 5080, release,XCL_FRAME_DUMP=1):PR (
b25ae0cf, RTX 5080, release,XCL_FRAME_DUMP=1):Not tested
nvwgf2umx.dllcrash onmain(did not reproduce on RTX 5080 onmain08db8020).scripts/smoke.ps1on the RTX 2080 SUPER.AI use
Ran via Samaritan: