D3D12.X: keep compositor render targets out of title tracking #2470

Open
Creaa wants to merge 1 commit from upstream-pr/2480 into main
Creaa commented 2026-11-25 19:52:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Creaa on 2026-11-25T19:52:53Z.


The presenter creates its render-target view through the same hooked D3D12 device as the title. Tracking that view adds a COM reference to the swap-chain back buffer that can prevent DXGI from resizing the buffers. Addresses the back-buffer reference in #2456. The sRGB format question in that issue remains open.

What is in it

The RTV creation and binding hooks skip title tracking during the presenter's own work. A regression test checks that the title's render target stays registered and bound while the compositor's handle stays out of both tables.

Tested

  • RTX 4070 12 GB (driver 617.14), i7-13700F, Windows 11 build 26300, Rust 1.100.0. Debug tests and release smoke runs.
  • cargo test -p xcl --lib compositor_render_targets_stay_out_of_title_tracking failed before the fix because both handles appeared in the table. On 7400291 it passed.
  • cargo build --workspace succeeded. cargo test --workspace --no-fail-fast -- --test-threads=4 reported 1414 passed, 0 failed, 46 ignored. The 29 SKIPPED messages covered wave64, unsupported direct-DXIL cases, heap windows, D3D12 debug layers and the driver cache setting that requires Developer Mode. The harness includes skipped cases in its pass count.

Regression run

main:

xcl-smoke v1
commit: 889ef3e8aa7f267323ab4879e735e65da6bcef10
gpu: NVIDIA GeForce RTX 4070
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1568 (PresentX 1568)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16816 MB

this PR:

xcl-smoke v1
commit: 74002910048796fe9504e2a0fd3bbff2063a9781
gpu: NVIDIA GeForce RTX 4070
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1578 (PresentX 1579)
presents per 2 s (last 3): 60 43 57
device removals: 0
crashes: 0
peak commit: 19203 MB

Not tested

The 60-second retail run did not specifically exercise a swap-chain resize after multi-plane composition. The unit test covers the references held by the tracking hooks.

AI use

OpenAI Codex (GPT-6) verified the tracking path, wrote the change and its regression test, ran the test suite and both smoke runs, and drafted this description.

<!-- greyfinch-sync:ivall/xcl:issue:5498127814 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2480). Originally posted by [Creaa](https://github.com/Creaa) on 2026-11-25T19:52:53Z. --- The presenter creates its render-target view through the same hooked D3D12 device as the title. Tracking that view adds a COM reference to the swap-chain back buffer that can prevent DXGI from resizing the buffers. Addresses the back-buffer reference in #2456. The sRGB format question in that issue remains open. **What is in it** The RTV creation and binding hooks skip title tracking during the presenter's own work. A regression test checks that the title's render target stays registered and bound while the compositor's handle stays out of both tables. **Tested** - RTX 4070 12 GB (driver 617.14), i7-13700F, Windows 11 build 26300, Rust 1.100.0. Debug tests and release smoke runs. - `cargo test -p xcl --lib compositor_render_targets_stay_out_of_title_tracking` failed before the fix because both handles appeared in the table. On `7400291` it passed. - `cargo build --workspace` succeeded. `cargo test --workspace --no-fail-fast -- --test-threads=4` reported 1414 passed, 0 failed, 46 ignored. The 29 SKIPPED messages covered wave64, unsupported direct-DXIL cases, heap windows, D3D12 debug layers and the driver cache setting that requires Developer Mode. The harness includes skipped cases in its pass count. **Regression run** main: ``` xcl-smoke v1 commit: 889ef3e8aa7f267323ab4879e735e65da6bcef10 gpu: NVIDIA GeForce RTX 4070 title: RetailTitle seconds: 60 exit: 0x0 frames shown: 1568 (PresentX 1568) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16816 MB ``` this PR: ``` xcl-smoke v1 commit: 74002910048796fe9504e2a0fd3bbff2063a9781 gpu: NVIDIA GeForce RTX 4070 title: RetailTitle seconds: 60 exit: 0x0 frames shown: 1578 (PresentX 1579) presents per 2 s (last 3): 60 43 57 device removals: 0 crashes: 0 peak commit: 19203 MB ``` **Not tested** The 60-second retail run did not specifically exercise a swap-chain resize after multi-plane composition. The unit test covers the references held by the tracking hooks. **AI use** OpenAI Codex (GPT-6) verified the tracking path, wrote the change and its regression test, ran the test suite and both smoke runs, and drafted this description.
bmjask commented 2026-11-25 20:35:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:35:52Z.

Review: COMMENTED


No source-level blocker found. IN_PRESENT is set before compositor recording, so compositor RTV/binding operations bypass title tracking while title operations outside presentation remain tracked; current CI and smoke evidence are green. The important remaining validation gap is an actual swap-chain ResizeBuffers exercise after multi-plane composition, the user-visible failure this prevents. The hook-level test does not cover that end-to-end path.

<!-- greyfinch-sync:ivall/xcl:review:6064609584 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2480#pullrequestreview-6064609584). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T20:35:52Z. **Review:** COMMENTED --- No source-level blocker found. IN_PRESENT is set before compositor recording, so compositor RTV/binding operations bypass title tracking while title operations outside presentation remain tracked; current CI and smoke evidence are green. The important remaining validation gap is an actual swap-chain ResizeBuffers exercise after multi-plane composition, the user-visible failure this prevents. The hook-level test does not cover that end-to-end path.
DavidM1911 commented 2026-11-25 21:05:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T20:34:26Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7173871121 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2480#issuecomment-7173871121). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T20:34:26Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
SlopTart commented 2026-11-25 21:05:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T20:52:02Z.


gpu_ suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
Targeted run of compositor_render_targets_stay_out_of_title_tracking: passed.

<!-- greyfinch-sync:ivall/xcl:comment:7174295001 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2480#issuecomment-7174295001). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T20:52:02Z. --- `gpu_` suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Targeted run of `compositor_render_targets_stay_out_of_title_tracking`: passed.
rgroenewoudt commented 2026-11-26 16:50:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by rgroenewoudt on 2026-11-26T16:50:08Z.


Tested on AMD Radeon RX 9070 (RDNA4) at this PR's head 7400291: no new failures.

Tested

  • AMD Radeon RX 9070, driver 32.0.32029.2010; AMD Ryzen 9 5950X; Windows 11 Pro build 26300; Rust 1.100.0 MSVC; DXC 1.9.2602.17; debug build- cargo test --workspace --no-fail-fast -- --test-threads=4: 1412 passed, 2 failed, 46 ignored. The 2 failures are fuzz_validate_and_gpu_1 (seed 722) and _3 (seed 1599), the AMD ones from #2115, not touched here.
  • SKIPPED (7): 6 × f16 / f32 per-lane forms refused (#1426); heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)

Not tested

  • No regression run on a real title (no game data here); this covers only the test suite on AMD

AI use

  • Claude Code (Claude Opus 5.5) ran the commands and wrote this report from the logs.
<!-- greyfinch-sync:ivall/xcl:comment:7198156022 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2480#issuecomment-7198156022). Originally posted by [rgroenewoudt](https://github.com/rgroenewoudt) on 2026-11-26T16:50:08Z. --- **Tested on AMD Radeon RX 9070 (RDNA4) at this PR's head `7400291`**: no new failures. **Tested** - AMD Radeon RX 9070, driver 32.0.32029.2010; AMD Ryzen 9 5950X; Windows 11 Pro build 26300; Rust 1.100.0 MSVC; DXC 1.9.2602.17; debug build- `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1412 passed, 2 failed, 46 ignored. The 2 failures are `fuzz_validate_and_gpu_1` (seed 722) and `_3` (seed 1599), the AMD ones from #2115, not touched here. - SKIPPED (7): 6 × f16 / f32 per-lane forms refused (#1426); `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows) **Not tested** - No regression run on a real title (no game data here); this covers only the test suite on AMD **AI use** - Claude Code (Claude Opus 5.5) ran the commands and wrote this report from the logs.
github-actions[bot] commented 2026-11-30 08:39:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:39:59Z.


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:7273190592 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2480#issuecomment-7273190592). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:39:59Z. --- 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 08:09:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:09:12Z.


Triage (#1607) – head 7400291

Not on main: main's note_rtv and note_rt0 in present.rs still check only enabled(). No other open PR makes this change as its own. The same guard appears in a fork commit (28ec004) carried in the base of several unrelated PRs (e.g. #2589), which has no PR of its own and is not on main. #2537 deals with the sRGB part of #2456.
The compositor's CreateRenderTargetView and OMSetRenderTargets run inside present_now, which sets IN_PRESENT, so the guard covers them. The test checks both tables and needs no GPU. No problems found in the diff.
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:7304942480 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2480#issuecomment-7304942480). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:09:12Z. --- **Triage (#1607)** – head 7400291 Not on main: main's `note_rtv` and `note_rt0` in `present.rs` still check only `enabled()`. No other open PR makes this change as its own. The same guard appears in a fork commit (28ec004) carried in the base of several unrelated PRs (e.g. #2589), which has no PR of its own and is not on main. #2537 deals with the sRGB part of #2456. The compositor's `CreateRenderTargetView` and `OMSetRenderTargets` run inside `present_now`, which sets `IN_PRESENT`, so the guard covers them. The test checks both tables and needs no GPU. No problems found in the diff. 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/2480:upstream-pr/2480'
git switch 'upstream-pr/2480'

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/2480'
git switch 'upstream-pr/2480'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2480'
git switch 'upstream-pr/2480'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2480'
git switch 'main'
git merge --squash 'upstream-pr/2480'
git switch 'main'
git merge --ff-only 'upstream-pr/2480'
git switch 'main'
git merge 'upstream-pr/2480'
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!2470
No description provided.