D3D12.X: use dedicated PC direct queue for PresentX under Wine (#175) #793

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

@⁠gsucristo on GitHub · 2026-11-24 05:33 UTC · original
gsucristo:d3d12x/wine-present-dedicated-queue → main · +201 −17 · 1 files · 1 commits · open

Use a dedicated presenter-owned unadopted PC direct command queue for DXGI swap-chain creation and PresentX copies when running under Wine, synchronized with the title's adopted queue via GPU fence Signal/Wait. Under Wine + vkd3d-proton, presenting on the title's adopted queue leaves the output window black. Native Windows behavior is unchanged. Part of #175.

What is in it

  • crates/xcl/src/hle/d3d12x/present.rs: add WineQueue and raw-vtable helpers (create_pc_queue, create_pc_allocator, create_pc_list, create_pc_fence) used only when util::under_wine() is true; bind the DXGI swap chain to the dedicated queue and fence-bridge title queue → presenter queue → title queue on each present.
  • crates/xcl/src/hle/d3d12x/present.rs (frame_dump_tests): add dedicated_pc_queue_copies_across_fence_from_title_queue verifying cross-queue fence-synchronized render target copy and readback.

Tested

  • NVIDIA GeForce RTX 4090 (driver 610.57.04), AMD Ryzen 9 7950X3D, Linux + Proton Experimental / vkd3d-proton (relaxed vtable check), rustc 1.98.1 (x86_64-pc-windows-msvc cross-compile), debug.
  • cargo test --workspace --no-fail-fast --target x86_64-pc-windows-msvc -- --test-threads=4 --skip a_freed_block_is_decommitted_before_its_address_is_reused: 700 passed, 4 failed (pre-existing Wine-only failures: hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime, test_title_runs_and_game_folder_is_untouched, disk_free_space_ex_reports_pls_quota, set_predication_buffer_state_and_kickoff), 41 ignored, 1 filtered (a_freed_block_is_decommitted_before_its_address_is_reused).
  • SKIPPED GPU tests: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64).
  • New GPU test passed: hle::d3d12x::present::frame_dump_tests::dedicated_pc_queue_copies_across_fence_from_title_queue.

Regression run

  • Pending native Windows scripts/smoke.ps1 runs on a retail title (Linux/Proton environment only).

Not tested

  • Native Windows 10/11 (code path is gated behind util::under_wine()), AMD RDNA, Intel GPUs, scripts/smoke.ps1 retail regression run.

AI use

  • Antigravity (Google DeepMind; exact model version not exposed to the agent) — assisted with code, test, and PR description; reviewed, built, and run on hardware by the author.
**@⁠gsucristo** on GitHub · 2026-11-24 05:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/793) `gsucristo:d3d12x/wine-present-dedicated-queue` → `main` · +201 −17 · 1 files · 1 commits · open Use a dedicated presenter-owned unadopted PC direct command queue for DXGI swap-chain creation and `PresentX` copies when running under Wine, synchronized with the title's adopted queue via GPU fence `Signal`/`Wait`. Under Wine + vkd3d-proton, presenting on the title's adopted queue leaves the output window black. Native Windows behavior is unchanged. Part of #175. **What is in it** - `crates/xcl/src/hle/d3d12x/present.rs`: add `WineQueue` and raw-vtable helpers (`create_pc_queue`, `create_pc_allocator`, `create_pc_list`, `create_pc_fence`) used only when `util::under_wine()` is true; bind the DXGI swap chain to the dedicated queue and fence-bridge title queue → presenter queue → title queue on each present. - `crates/xcl/src/hle/d3d12x/present.rs` (`frame_dump_tests`): add `dedicated_pc_queue_copies_across_fence_from_title_queue` verifying cross-queue fence-synchronized render target copy and readback. **Tested** - NVIDIA GeForce RTX 4090 (driver 610.57.04), AMD Ryzen 9 7950X3D, Linux + Proton Experimental / vkd3d-proton (relaxed vtable check), `rustc 1.98.1` (`x86_64-pc-windows-msvc` cross-compile), debug. - `cargo test --workspace --no-fail-fast --target x86_64-pc-windows-msvc -- --test-threads=4 --skip a_freed_block_is_decommitted_before_its_address_is_reused`: 700 passed, 4 failed (pre-existing Wine-only failures: `hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime`, `test_title_runs_and_game_folder_is_untouched`, `disk_free_space_ex_reports_pls_quota`, `set_predication_buffer_state_and_kickoff`), 41 ignored, 1 filtered (`a_freed_block_is_decommitted_before_its_address_is_reused`). - `SKIPPED` GPU tests: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask` (`no wave64`), `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (`no wave64`). - New GPU test passed: `hle::d3d12x::present::frame_dump_tests::dedicated_pc_queue_copies_across_fence_from_title_queue`. **Regression run** - Pending native Windows `scripts/smoke.ps1` runs on a retail title (Linux/Proton environment only). **Not tested** - Native Windows 10/11 (code path is gated behind `util::under_wine()`), AMD RDNA, Intel GPUs, `scripts/smoke.ps1` retail regression run. **AI use** - Antigravity (Google DeepMind; exact model version not exposed to the agent) — assisted with code, test, and PR description; reviewed, built, and run on hardware by the author.
Under Wine + vkd3d-proton, creating the DXGI swap chain and submitting the
present copy on the title's adopted command queue leaves the window black.

When running under Wine (`util::under_wine()`), allocate a presenter-owned
unadopted PC direct queue, allocator, command list, and sync fences via the
raw device vtable, hand out the swap chain on that queue, and synchronize
each present copy across the title queue and presenter queue with GPU fence
Signal/Wait. Native Windows behavior is unchanged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:32:44 +00:00
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 05:51 UTC · original

Test run of 6f4bef3c81a981d8c85a2bb7f153115ddb00e61c on AMD RDNA4. I merged it onto current main e50836b locally (clean merge).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200 (native Windows, not Wine), Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 705 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 664 passed, 0 failed, 21 ignored
  • 0 SKIPPED; the present tests pass.

Review: Under Wine it presents on a dedicated PC direct queue; on native Windows, which is what this run is, the behaviour is meant to be unchanged, and the suite agrees. I could not run it under Wine, so the black-window fix itself is not checked here.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

**@⁠MesshM** on GitHub · 2026-11-24 05:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/793#issuecomment-7123338493) Test run of `6f4bef3c81a981d8c85a2bb7f153115ddb00e61c` on AMD RDNA4. I merged it onto current `main` `e50836b` locally (clean merge). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200 (native Windows, not Wine), Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **705 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 664 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; the `present` tests pass. **Review:** Under Wine it presents on a dedicated PC direct queue; on native Windows, which is what this run is, the behaviour is meant to be unchanged, and the suite agrees. I could not run it under Wine, so the black-window fix itself is not checked here. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Author
Owner

@⁠mastrr9 on GitHub · 2026-11-24 06:18 UTC · original

Clean-room build, audit, and native hardware test run on NVIDIA RTX 5080 (Windows 11 Pro 25H2 26200.9974, driver 617.42 / 32.0.16.1742, rustc 1.100.0, DXC Windows SDK 10.0.26100.0).

  • Commit tested: 6f4bef3c81a981d8c85a2bb7f153115ddb00e61c
  • Build (cargo build --workspace): clean (only the pre-existing fetch_update deprecation warning).
  • Tests (cargo test --workspace -- --test-threads=4): 705 passed; 0 failed; 41 ignored (SKIPPED: only the 2 hardware no wave64 tests).
  • PR-specific test: hle::d3d12x::present::frame_dump_tests::dedicated_pc_queue_copies_across_fence_from_title_queue passed on real hardware.
  • Audit: Clean — Wine-only branch stays inert on native Windows; orig_fn slots (8/9/12/36) match ID3D12Device vtable order and signatures (CreateCommandQueue, CreateCommandAllocator, CreateCommandList, CreateFence), and COM ownership via from_raw is balanced. One tiny non-blocking note: title_q.Wait(&p.fence, ...) ignores its Result, though CPU waits still prevent corruption.

(Clean-room hardware check only; no retail title or smoke.ps1 run. Assisted-by: Antigravity / Claude Sonnet 5.5 + Gemini 4 Neon)

**@⁠mastrr9** on GitHub · 2026-11-24 06:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/793#issuecomment-7123793805) Clean-room build, audit, and native hardware test run on NVIDIA RTX 5080 (Windows 11 Pro 25H2 `26200.9974`, driver `617.42` / `32.0.16.1742`, `rustc 1.100.0`, DXC Windows SDK `10.0.26100.0`). - **Commit tested:** `6f4bef3c81a981d8c85a2bb7f153115ddb00e61c` - **Build (`cargo build --workspace`):** clean (only the pre-existing `fetch_update` deprecation warning). - **Tests (`cargo test --workspace -- --test-threads=4`):** **`705 passed; 0 failed; 41 ignored`** (`SKIPPED`: only the 2 hardware `no wave64` tests). - **PR-specific test:** `hle::d3d12x::present::frame_dump_tests::dedicated_pc_queue_copies_across_fence_from_title_queue` passed on real hardware. - **Audit:** Clean — Wine-only branch stays inert on native Windows; `orig_fn` slots (8/9/12/36) match `ID3D12Device` vtable order and signatures (`CreateCommandQueue`, `CreateCommandAllocator`, `CreateCommandList`, `CreateFence`), and COM ownership via `from_raw` is balanced. One tiny non-blocking note: `title_q.Wait(&p.fence, ...)` ignores its `Result`, though CPU waits still prevent corruption. *(Clean-room hardware check only; no retail title or `smoke.ps1` run. Assisted-by: Antigravity / Claude Sonnet 5.5 + Gemini 4 Neon)*
Author
Owner

@⁠Anon64 on GitHub · 2026-11-24 07:17 UTC · original

Regression runs for this PR's head 6f4bef3 and for its base main d208e14, on a retail title (same title, 60 s each), made with scripts/smoke.ps1 (release, clean tree at each commit) and pasted unedited, for Regression run.

main:

xcl-smoke v1
commit: d208e14b765f469f4b56301b78afa8dac5378339
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1647 (PresentX 1648)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16733 MB

this PR:

xcl-smoke v1
commit: 6f4bef3c81a981d8c85a2bb7f153115ddb00e61c
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1641 (PresentX 1641)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 16722 MB

Tested

  • NVIDIA GeForce RTX 3060 12 GB (driver 581.80, wave32), Intel Core i9-14900KF, Windows 11 25H2 26200.9974 (native Windows), Rust 1.90.0

Not tested

  • the unit tests on this machine
  • Wine: on native Windows the Wine-only path is not taken; this is a regression check only

Report written with Claude Code (Claude Opus 5.5) from runs on this machine.

**@⁠Anon64** on GitHub · 2026-11-24 07:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/793#issuecomment-7124834587) Regression runs for this PR's head `6f4bef3` and for its base `main` `d208e14`, on a retail title (same title, 60 s each), made with `scripts/smoke.ps1` (release, clean tree at each commit) and pasted unedited, for **Regression run**. main: ``` xcl-smoke v1 commit: d208e14b765f469f4b56301b78afa8dac5378339 gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1647 (PresentX 1648) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16733 MB ``` this PR: ``` xcl-smoke v1 commit: 6f4bef3c81a981d8c85a2bb7f153115ddb00e61c gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1641 (PresentX 1641) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 16722 MB ``` **Tested** - NVIDIA GeForce RTX 3060 12 GB (driver 581.80, wave32), Intel Core i9-14900KF, Windows 11 25H2 26200.9974 (native Windows), Rust 1.90.0 **Not tested** - the unit tests on this machine - Wine: on native Windows the Wine-only path is not taken; this is a regression check only Report written with Claude Code (Claude Opus 5.5) from runs on this machine.
Author
Owner

@⁠Filip722 on GitHub · 2026-11-25 05:08 UTC · original

On an RTX 5060 Laptop GPU (8 GB), the cross-queue regression passed under Proton in 1.16 s with no skip. It read the expected green texel after a clear on the title queue and a fenced copy on the presenter queue.

I also compared main 6987e496c35653f9ccc9dbdc1f1d342734306811 with only this PR's patch from 6f4bef3c81a981d8c85a2bb7f153115ddb00e61c applied. Each Series X run started from an independent copy of the same offline profile, shader and driver caches. The patched run confirmed it selected the dedicated PC direct queue.

Observation Main With #793
Present-source frames sampled 20, 116, 212, 308, 404, 500 20, 116, 212
Samples above the black threshold per source frame 0 / 518,400 0 / 518,400
Entirely black title-window captures 18 / 18 14 / 14
Storage requests / failures 9,764 / 0 9,764 / 0
Free VRAM when the guard stopped the run 2,494 MiB 2,474 MiB

The input to presentation was already black on the three frames sampled by both builds. The patched run ended before frame 404. I couldn't verify a visible title screen in this workload with the queue change alone.

Bazzite 44, kernel 7.2.9-ogc2.1.fc44.x86_64, NVIDIA 615.78.08, Proton Experimental 11.0-20261112, vkd3d-proton 3.1.0 (4522cc1a8b1347f+), Rust 1.98.1 Windows MSVC target. Codex (GPT-6.2-Sol, high reasoning) assisted with the builds, tests and this report.

**@⁠Filip722** on GitHub · 2026-11-25 05:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/793#issuecomment-7153483291) On an RTX 5060 Laptop GPU (8 GB), the cross-queue regression passed under Proton in 1.16 s with no skip. It read the expected green texel after a clear on the title queue and a fenced copy on the presenter queue. I also compared main `6987e496c35653f9ccc9dbdc1f1d342734306811` with only this PR's patch from `6f4bef3c81a981d8c85a2bb7f153115ddb00e61c` applied. Each Series X run started from an independent copy of the same offline profile, shader and driver caches. The patched run confirmed it selected the dedicated PC direct queue. | Observation | Main | With #793 | | --- | ---: | ---: | | Present-source frames sampled | 20, 116, 212, 308, 404, 500 | 20, 116, 212 | | Samples above the black threshold per source frame | 0 / 518,400 | 0 / 518,400 | | Entirely black title-window captures | 18 / 18 | 14 / 14 | | Storage requests / failures | 9,764 / 0 | 9,764 / 0 | | Free VRAM when the guard stopped the run | 2,494 MiB | 2,474 MiB | The input to presentation was already black on the three frames sampled by both builds. The patched run ended before frame 404. I couldn't verify a visible title screen in this workload with the queue change alone. Bazzite 44, kernel 7.2.9-ogc2.1.fc44.x86_64, NVIDIA 615.78.08, Proton Experimental 11.0-20261112, vkd3d-proton 3.1.0 (`4522cc1a8b1347f+`), Rust 1.98.1 Windows MSVC target. Codex (GPT-6.2-Sol, high reasoning) assisted with the builds, tests and this report.
Author
Owner

@⁠ClosetPie107 on GitHub · 2026-11-25 10:53 UTC · original

Linux / AMD RDNA4 (RADV) test report on 6f4bef3 merged locally onto main 568e7db (clean merge).

Environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton v3.1 (#257 + dxil-spirv 53aac418), DXVK v3.1.1-209, DXC 1.9.2609.5, x86_64-pc-windows-gnu cross-compile

Unit & GPU tests (debug test binary, XCL_ADAPTER=9070 XCL_REQUIRE_GPU=wave64, --test-threads=1 --nocapture)

  • hle::d3d12x::present: 7 passed, 0 failed, 0 ignored, 0 skipped (0.21 s), including dedicated_pc_queue_copies_across_fence_from_title_queue.

Short retail check under Wine/RADV (release xcl.exe, XCL_RUN_SECONDS=35, XCL_NETWORK=0, XCL_COHERENT_MB=512, XCL_ADAPTER=9070)

  • Selected the Wine path: present: using a dedicated PC direct queue under Wine
  • Presented 851 frames at 30.0 fps (851 PresentX calls), exit 0, 0 device removals, 0 crashes.
  • Note: XCL_DXC_DIR was not passed in this 35 s run (no DXC logged), so this confirms the dedicated presenter queue lifecycle and frame pacing under Wine/RADV, not rendered pixel content.

Not tested: full workspace suite, rendered pixel verification with DXC set, native Windows.

AI use: T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran these checks on this machine, and drafted this report.

**@⁠ClosetPie107** on GitHub · 2026-11-25 10:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/793#issuecomment-7160305864) Linux / AMD RDNA4 (RADV) test report on `6f4bef3` merged locally onto `main` `568e7db` (clean merge). **Environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS - Proton Experimental (`experimental-11.0-20261112`), vkd3d-proton v3.1 (`#257` + `dxil-spirv` `53aac418`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, `x86_64-pc-windows-gnu` cross-compile **Unit & GPU tests** (debug test binary, `XCL_ADAPTER=9070 XCL_REQUIRE_GPU=wave64`, `--test-threads=1 --nocapture`) - `hle::d3d12x::present`: **7 passed, 0 failed, 0 ignored, 0 skipped** (0.21 s), including `dedicated_pc_queue_copies_across_fence_from_title_queue`. **Short retail check under Wine/RADV** (release `xcl.exe`, `XCL_RUN_SECONDS=35`, `XCL_NETWORK=0`, `XCL_COHERENT_MB=512`, `XCL_ADAPTER=9070`) - Selected the Wine path: `present: using a dedicated PC direct queue under Wine` - Presented **851 frames** at **30.0 fps** (`851 PresentX calls`), exit `0`, 0 device removals, 0 crashes. - Note: `XCL_DXC_DIR` was not passed in this 35 s run (`no DXC` logged), so this confirms the dedicated presenter queue lifecycle and frame pacing under Wine/RADV, not rendered pixel content. **Not tested:** full workspace suite, rendered pixel verification with DXC set, native Windows. **AI use:** T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran these checks on this machine, and drafted this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 10:58 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-25 10:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/793#issuecomment-7160421829) 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!
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/hle/d3d12x/present.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/793/head:github-bot/gh-793'
git switch 'github-bot/gh-793'

Merge

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