Skip to content

D3D12.X: mark GPU writes and map formats in ResolveSubresource - #1563

Open
hajduzsolt wants to merge 1 commit into
xcl-dev:mainfrom
hajduzsolt:d3d12x/resolve-subresource-note-write-and-format
Open

hajduzsolt wants to merge 1 commit into
xcl-dev:mainfrom
hajduzsolt:d3d12x/resolve-subresource-note-write-and-format

Conversation

@hajduzsolt

@hajduzsolt hajduzsolt commented Nov 24, 2026 •

Copy link
Copy Markdown

Marks itle_textures destinations as GPU-written and translates console DXGI formats via device_x::pc_target_format in resolve_subresource_x and resolve_subresource_region_x. Part of #1489.

What is in it

  • crates/xcl/src/hle/d3d12x/list_x.rs: call itle_textures::note_gpu_write(dst) and translate format with device_x::pc_target_format in resolve_subresource_x and resolve_subresource_region_x.
  • crates/xcl/src/hle/d3d12x/title_textures.rs & list_x.rs: add unit test resolve_subresource_notes_gpu_write_and_translates_console_format (with test-only itle_textures seeding/inspection helpers) covering gpu_written tracking and B4G4R4A4_UNORM / console depth format translation.

Tested

  • Hardware & toolchain: AMD Radeon RX 9070 XT (driver 32.0.32029.2010), AMD Ryzen 7 9800X3D, Windows 11 10.0.26300.9974, rustc 1.98.1 (48a229cea 2026-09-01), debug (cargo test).
  • cargo test -p xcl --lib hle::d3d12x::list_x::tests::resolve_subresource -- --test-threads=2: 1 passed, 0 failed, 0 ignored.
  • cargo test --workspace -- --test-threads=2: 777 passed, 0 failed, 41 ignored (xcl --lib: 728 passed, 0 failed, 21 ignored; integration/e2e suites: 49 passed, 0 failed, 20 ignored).
  • SKIPPED runtime tests: SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows.

Regression run

main:

xcl-smoke v1
commit: 082944135cd2b96288470a595861fa608eee08dc
gpu: AMD Radeon RX 9070 XT
title: b0ea61d5
seconds: 60
exit: 0x0
frames shown: 1678 (PresentX 1678)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13681 MB

PR:

xcl-smoke v1
commit: fbf6b955410c929cd01edda38d1dddf4d274ccef
gpu: AMD Radeon RX 9070 XT
title: b0ea61d5
seconds: 60
exit: 0x0
frames shown: 1674 (PresentX 1674)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14581 MB

Not tested

  • NVIDIA and Intel Arc adapters.

AI use

  • Antigravity (Gemini 4 Hydrogen, high): implemented
  • ote_gpu_write and pc_target_format handling in resolve_subresource_x / resolve_subresource_region_x, wrote unit tests, ran the test suite, and prepared commit and PR description.

@hajduzsolt
hajduzsolt force-pushed the d3d12x/resolve-subresource-note-write-and-format branch from 30ee1a4 to 27caa88 Compare November 24, 2026 18:54
@hajduzsolt
hajduzsolt marked this pull request as ready for review November 24, 2026 19:23
@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.

Thanks!

@JJAutoCompare

Copy link
Copy Markdown

Empirical test report (27caa88)

Tested PR #1563 at commit 27caa8812c01a1c76a4ea80d77868d7b4afcbab9.

Hardware / environment

Windows x64 build 26200 on an AMD64 host (family 23, model 113, stepping 0). Rust 1.100.0 (0ef1bc386 2026-11-09) and DXC 1.9.2609.5 (01b62ad47). The focused fixture ran outside the Arc wrapper with XCL_ADAPTER=NONE_CPU_ONLY and RUST_TEST_NOCAPTURE=1. Cargo used the default test profile with debug information and incremental compilation disabled.

Commands and results

  • cargo test --workspace --no-run exited 0 and built the workspace test executables.
  • cargo test -p xcl --lib hle::d3d12x::list_x::tests::resolve_subresource_notes_gpu_write_and_translates_console_format -- --exact exited 0. The focused log recorded 1 passed, 0 failed, 0 ignored, and 0 SKIPPED markers.

Observed behavior

The fixture called both XCL resolve wrappers with a mock command-list vtable and two seeded destination entries. Both destinations were marked GPU-written. The mock PC callbacks captured format 28 (R8G8B8A8_UNORM) for console format 115 and format 45 (D24_UNORM_S8_UINT) for console format 118.

Not tested

The full GPU workspace suite and game smoke runs were omitted. The fixture covers wrapper bookkeeping and the format arguments forwarded to the mock callbacks. Actual D3D12 resolve execution and texture contents on a GPU remain unverified.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1563-focused.log and published.

ResolveSubresource and ResolveSubresourceRegion omitted title_textures::note_gpu_write(dst) and forwarded untranslated console DXGI formats to PC D3D12. Mark dst as GPU-written and translate formats with device_x::pc_target_format so resolved placed textures are not overwritten by stale CPU uploads and match promoted PC target formats.

Part of xcl-dev#1489

Assisted-by: Antigravity (Gemini 4 Hydrogen, high)
@hajduzsolt
hajduzsolt marked this pull request as draft November 25, 2026 15:25
@hajduzsolt
hajduzsolt force-pushed the d3d12x/resolve-subresource-note-write-and-format branch from 27caa88 to fbf6b95 Compare November 25, 2026 15:25
@hajduzsolt
hajduzsolt marked this pull request as ready for review November 25, 2026 15:33
@b3IKK

b3IKK commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

A merge note for rebasing onto 06c9f55 (I hit this on my now-closed duplicate #1787): note_gpu_write changed shape on main — it sets marked inside a block and drops the TEXTURES lock before STREAM_RECHECK, and release's ABA guard now has to cover extra_active, spares and first. The rest of the two-file change applies as-is; the branch built and the suite/smoke pair passed there.

AI use: OpenCode, Claude Fable 5.2 rebased the duplicate, resolved that conflict and wrote this.

@DavidM1911

Copy link
Copy Markdown
Contributor

Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current main on the new head — needs another rebase before it can be tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants