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

Open
hajduzsolt wants to merge 1 commit from upstream-pr/1563 into main
hajduzsolt commented 2026-11-24 17:42:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by hajduzsolt on 2026-11-24T17:42:49Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:5477320134 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1563). Originally posted by [hajduzsolt](https://github.com/hajduzsolt) on 2026-11-24T17:42:49Z. --- 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.
DavidM1911 commented 2026-11-24 21:09:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T19:41:22Z.


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

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

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7142450871 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1563#issuecomment-7142450871). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T19:41:22Z. --- 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 commented 2026-11-25 06:05:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:20:07Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7153671559 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1563#issuecomment-7153671559). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T05:20:07Z. --- ### 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.
b3IKK commented 2026-11-25 18:04:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-25T18:03:51Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7170386922 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1563#issuecomment-7170386922). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-25T18:03:51Z. --- 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 commented 2026-11-26 06:06:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T05:48:33Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7183824290 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1563#issuecomment-7183824290). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T05:48:33Z. --- 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.
github-actions[bot] commented 2026-12-01 02:33:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:33:10Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7298739127 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1563#issuecomment-7298739127). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-12-01T02:33:10Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 06:07:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:07:58Z.


Triage (#1607) – head fbf6b95

Same change as #1787 (D90), which is closed unmerged. Main has since moved part of it in another form: resolve_subresource_x / resolve_subresource_region_x now call note_texture_write(this, dst, dst_sub), so the added title_textures::note_gpu_write(dst) repeats that on rebase and should be dropped.
The format mapping (device_x::pc_target_format on the resolve format, e.g. console 118 -> 45, 115 -> 28) is still not on main, and is the part worth keeping.
The branch conflicts with main and needs a rebase.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7302516314 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1563#issuecomment-7302516314). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:07:58Z. --- **Triage (#1607)** – head fbf6b95 Same change as #1787 (D90), which is closed unmerged. Main has since moved part of it in another form: `resolve_subresource_x` / `resolve_subresource_region_x` now call `note_texture_write(this, dst, dst_sub)`, so the added `title_textures::note_gpu_write(dst)` repeats that on rebase and should be dropped. The format mapping (`device_x::pc_target_format` on the resolve format, e.g. console 118 -> 45, 115 -> 28) is still not on main, and is the part worth keeping. The branch conflicts with main and needs a rebase. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1563:upstream-pr/1563'
git switch 'upstream-pr/1563'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1563'
git switch 'upstream-pr/1563'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1563'
git switch 'upstream-pr/1563'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1563'
git switch 'main'
git merge --squash 'upstream-pr/1563'
git switch 'main'
git merge --ff-only 'upstream-pr/1563'
git switch 'main'
git merge 'upstream-pr/1563'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1553
No description provided.