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

Open
github-bot wants to merge 1 commit from github-bot/gh-1563 into main AGit
Owner

@⁠hajduzsolt on GitHub · 2026-11-24 17:42 UTC · original
hajduzsolt:d3d12x/resolve-subresource-note-write-and-format → main · +93 −0 · 2 files · 1 commits · open

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** on GitHub · 2026-11-24 17:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/1563) `hajduzsolt:d3d12x/resolve-subresource-note-write-and-format` → `main` · +93 −0 · 2 files · 1 commits · open 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.
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 #1489

Assisted-by: Antigravity (Gemini 4 Hydrogen, high)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:57:37 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 19:41 UTC · original

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

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

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 19:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1563#issuecomment-7142450871) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 05:20 UTC · original

Empirical test report (27caa881)

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.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 05:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/1563#issuecomment-7153671559) ### Empirical test report (27caa881) 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.
Author
Owner

@⁠b3IKK on GitHub · 2026-11-25 18:03 UTC · original

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.

**@⁠b3IKK** on GitHub · 2026-11-25 18:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/1563#issuecomment-7170386922) 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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 05:48 UTC · original

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.

**@⁠DavidM1911** on GitHub · 2026-11-26 05:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/1563#issuecomment-7183824290) 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.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/hle/d3d12x/list_x.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1563/head:github-bot/gh-1563'
git switch 'github-bot/gh-1563'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1563'
git switch 'github-bot/gh-1563'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1563'
git switch 'github-bot/gh-1563'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1563'
git switch 'main'
git merge --squash 'github-bot/gh-1563'
git switch 'main'
git merge --ff-only 'github-bot/gh-1563'
git switch 'main'
git merge 'github-bot/gh-1563'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.