Skip to content

d3d12: create_window_presenter looks behind the Xbox device proxy (D3D-414) - #3925

Open
kotorvr wants to merge 1 commit into
ItsNotRexed:mainfrom
kotorvr:fix/presenter-unwrap-proxy
Open

kotorvr wants to merge 1 commit into
ItsNotRexed:mainfrom
kotorvr:fix/presenter-unwrap-proxy

Conversation

@kotorvr

@kotorvr kotorvr commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

D3D-414. Claim: #3796 (comment) (the finding: #3796 (comment); passed to us by the coordinator after the other claimant released it).

The problem

rt::d3d12::create_window_presenter (runtime/shims/d3d12_vulkan_device.cpp) did Device::from<Device>(device) on what it was given. The helpers around it (device_has_swapchain_colorspace directly above, vulkan_device_info, register_samplers, create_dxgi_factory and others) first look behind the Xbox-ABI proxy with rt::d3d12_xs::device_proxy_real_device; this one did not, and the proxy's QueryInterface refuses the layer's private tag. So with the device a title actually holds (the proxy that D3D12XboxCreateDevice returns), it returned null and logged nothing.

Nobody had seen it because every test passes the device behind the proxy (inner in xbox_present_test), and XboxPresentation is built nowhere outside tests yet. Whoever wires PresentX from the proxy (D3D-366) would have got a null presenter, so no first frame, with no reason in the log.

The change

  • Resolve the proxy first, as the neighbours do: one line.
  • A line on stderr when the function is handed a device that is neither the proxy nor one of the layer's, so the remaining null case says why.

Tests

Windows 11, MSVC 14.44 (VS 2022), the CMake and Ninja that Visual Studio ships (3.31.6), SDK 10.0.26100, RelWithDebInfo, NVIDIA RTX 4090 (driver 621.14). No game files.

Check Result
xbox_present_test, new case: create_window_presenter(device.p, window) with the proxy (the test already holds it), then enable_capture and present_blank(1) presenter created, blank frame S_OK; the rest of the test unchanged
Negative control: the lookup as on main (no unwrap) the new case fails at from_proxy && from_proxy->enable_capture(), and the new log line names the device
Full ctest on this head (main aa2988c + this commit, 154 tests) 0 of 153 enabled tests fail: 144 pass and 9 skip (package- or feature-gated: shader_library_corpus, bink_decode, bink_play_headless, fsr_dispatch, bvh_builder, bink_audio, vk_sync_validation, d3d12_first_light, d3d12_rgb9e5_rtv); gameinput is disabled (no SDL3)

xbox_present_test prints two [rt] d3d12: present failed (VkResult -11) lines with and without this change; they come from an existing case on main.

Not tested: a device from another D3D12 implementation (the log line is read from the code, and the negative control shows it for the proxy case).

AI-assisted (Claude Code).

🤖 Generated with Claude Code

…D-414)

A title holds the Xbox-ABI proxy, and create_window_presenter looked up the
layer's device on the pointer it was given, so with the proxy it returned null
and logged nothing. It now resolves the proxy first, as the helpers around it
do, and says on stderr when it is handed a device that is neither.

xbox_present_test creates a presenter from the proxy and presents a blank
frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@justr4mzi

Copy link
Copy Markdown
Contributor

Tested 0ee1deff on AMD Radeon RX 6700 XT (gfx1031, Windows 11 25H2 build 26200.9974, AMD driver 26.11.2, Vulkan 1.4.315, MSVC 19.44.35230.0, CMake + Ninja RelWithDebInfo):

  • Build (xbox_present_test): exit 0.
  • Standard ctest --test-dir runtime/build --output-on-failure -R "xbox_present": 1/1 passed (#110 xbox_present, 3.17 s).
  • Direct xbox_present_test.exe run: presenter from the Xbox device proxy: created, a blank frame presented: ok -> xbox_present_test: all cases pass (exit 0; HDR10 swapchain case skipped cleanly on SDR display).
  • Validation (LEONIDA_VK_VALIDATION=1 ctest --test-dir runtime/build --output-on-failure -R "xbox_present"): 1/1 passed (2.64 s), 0 validation errors.

AI-assisted (Gemini, Antigravity).

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 0ee1deff on Windows 11 (RTX 5070 Ti, driver 621.24).

  • Built xbox_present_test in a private RelWithDebInfo/Ninja build.
  • xbox_present_test.exe -> exit 0: all cases pass, including the new "presenter from the Xbox device proxy: created, a blank frame presented: ok".
  • ctest -R xbox_present -> 1/1 passed, 2.13 s.

The existing compose, resize, suspend/resume, tearing and LEGACY/no-tear cases still pass, so the proxy unwrap did not change the direct path. The helper now matches the other creator functions. No game files; no blocker.

@Ayinaki

Ayinaki commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 0ee1deff on NVIDIA GeForce RTX 5070 (driver 616.86), Windows 11 build 26200, MSVC RelWithDebInfo: pass.

  • xbox_present_test: xbox_present_test: all cases pass, which includes the new create_window_presenter(device.p, window) case going through the proxy and then enable_capture/present_blank. Presentation paced 30 frames at 60 Hz in 502 ms (ideal 500).
  • Second vendor on this commit (the existing check is gfx1031); it also covers the NVIDIA driver path, where the proxy/window presenter is what actually runs.

@itsonlysimbo

Copy link
Copy Markdown
Contributor

Tested 0ee1deff on RTX 4070, NVIDIA 621.14, Windows 11 (10.0.26300), MSVC 19.44, Ninja, RelWithDebInfo, Vulkan SDK 1.4.363: pass.

  • xbox_present passes.
  • ctest: 144 passed, 10 skipped, 0 failed; run_gpu_tests.py: 164/210 passed, 46 skipped, 0 failed, same as main aa2988cc.

AI-assisted (Claude Code).

@AirKyzzZ

Copy link
Copy Markdown

Tested 0ee1deff on RTX 2060, NVIDIA 566.14, Windows 10 22H2 (19045), clang-cl 23.1.6 + SDK 10.0.26100: pass.

ctest -R ^xbox_present$ passes and prints presenter from the Xbox device proxy: created, a blank frame presented: ok. Negative control: with the unwrap replaced by nullptr (not committed), it fails at line 1256: from_proxy && from_proxy->enable_capture() and the new stderr line names the proxy's address. Full ctest on main aa2988cc + #3925 + #3926 + #3928 merged: 130 passed / 10 skipped, the only failure is d3d12_vulkan_device (line 5124), the known Windows 10 host comparison #3557 fixes, same as on main. The present failed (VkResult -11) lines you mention show up on main aa2988cc here too (five per run rather than two), so they don't come from this change. AI-assisted.

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.

6 participants