d3d12_xs: keep the Win32 PresentX window responsive during rendering #526

Merged
Rain156 merged 21 commits from upstream-pr/526 into main 2026-11-25 02:33:48 +00:00
Rain156 commented 2026-11-24 06:57:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Rain156 on 2026-11-24T06:57:08Z.


Claimed in the coordination issue as: RT-PRESENTX-WINDOW-PUMP (claim).

Depends on: #414

What and why

The Win32 fallback window created by #414 belongs to the rendering thread. On native Windows the window stopped answering messages during pipeline compilation, and it could still be marked hung while draws and presents continued. Give this HWND a dedicated message thread. Release its Vulkan presenter before waking and joining the window owner on shutdown.

The change to review is ce3e5153f. The preceding PresentX commits are from #414. The title-owned window path is outside this change.

Tested

  • MSVC x64 RelWithDebInfo builds of the runtime and the window, queue and device tests on Windows 11 Pro x64 build 26200.
  • The new hidden-window test passed 25 consecutive runs. It sends synchronous messages while the calling thread does no dispatch, closes one of two windows and destroys the other from a different thread. The queue proxy test passed.
  • On the retail frame-loop integration with the same window-ownership change, the fallback window answered a synchronous WM_NULL probe in 0.08 ms while the game was running. Before the change Windows reported the fallback HWND hung. Captured frames were still black. GPU content is a separate open problem.
  • The device proxy test has two failures in the slot 25 resource-allocation-info checks on this Windows machine. Both fail on the untouched #414 head and on the updated stack.
  • Repository-wide game-data check passed.

GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 617.42, Windows 11 Pro x64. The hidden-window test needs only a Win32 desktop.

AI-assisted: yes, OpenAI Codex.

Checklist

  • Current main is merged into the stack and the branch merges cleanly.
  • One window-lifetime change on top of #414.
  • No game data, keys or decryption.
  • No translator rule changed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5467598472 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/526). Originally posted by [Rain156](https://github.com/Rain156) on 2026-11-24T06:57:08Z. --- Claimed in the coordination issue as: RT-PRESENTX-WINDOW-PUMP ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7124105269)). Depends on: #414 ### What and why The Win32 fallback window created by #414 belongs to the rendering thread. On native Windows the window stopped answering messages during pipeline compilation, and it could still be marked hung while draws and presents continued. Give this HWND a dedicated message thread. Release its Vulkan presenter before waking and joining the window owner on shutdown. The change to review is [ce3e5153f](https://github.com/Rain156/leonida-contrib/commit/ce3e5153f). The preceding PresentX commits are from #414. The title-owned window path is outside this change. ### Tested - MSVC x64 RelWithDebInfo builds of the runtime and the window, queue and device tests on Windows 11 Pro x64 build 26200. - The new hidden-window test passed 25 consecutive runs. It sends synchronous messages while the calling thread does no dispatch, closes one of two windows and destroys the other from a different thread. The queue proxy test passed. - On the retail frame-loop integration with the same window-ownership change, the fallback window answered a synchronous `WM_NULL` probe in 0.08 ms while the game was running. Before the change Windows reported the fallback HWND hung. Captured frames were still black. GPU content is a separate open problem. - The device proxy test has two failures in the slot 25 resource-allocation-info checks on this Windows machine. Both fail on the untouched #414 head and on the updated stack. - Repository-wide game-data check passed. GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 617.42, Windows 11 Pro x64. The hidden-window test needs only a Win32 desktop. AI-assisted: yes, OpenAI Codex. ### Checklist - [x] Current `main` is merged into the stack and the branch merges cleanly. - [x] One window-lifetime change on top of #414. - [x] No game data, keys or decryption. - [x] No translator rule changed.
DesertGamer commented 2026-11-24 13:32:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DesertGamer on 2026-11-24T13:32:38Z.


Independent check of the window pump on a second native-Windows machine. Windows 11, RTX 5070, driver 617.14, LEONIDA_D3D12=vulkan, own 1.0.2.1 copy. I cherry-picked the single commit ce3e5153f (the present_window.h change) onto main 21625bca8 + #427 + #602 + #387 + #357 + #432; it applied without conflicts and built, so on this tree it did not need #414.

Responding state of the LeonidaPresentX window, polled with Process.Responding while gta6rt --run boots the title:

t without this commit with this commit
35 s False True
45 s False True
55 s False True

The "without" column is from an earlier build of a near-identical stack (#359 and #727 in place of #432 and the others, same machine), not the same tree, so read it as the symptom and not as a paired A/B. What I did not check: dragging, minimising or closing the window, or a run past 55 s.

AI-assisted: yes (Claude Code, Sonnet 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7132981271 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/526#issuecomment-7132981271). Originally posted by [DesertGamer](https://github.com/DesertGamer) on 2026-11-24T13:32:38Z. --- Independent check of the window pump on a second native-Windows machine. Windows 11, RTX 5070, driver 617.14, `LEONIDA_D3D12=vulkan`, own 1.0.2.1 copy. I cherry-picked the single commit `ce3e5153f` (the `present_window.h` change) onto `main` 21625bca8 + #427 + #602 + #387 + #357 + #432; it applied without conflicts and built, so on this tree it did not need #414. Responding state of the `LeonidaPresentX` window, polled with `Process.Responding` while `gta6rt --run` boots the title: | t | without this commit | with this commit | |---|---|---| | 35 s | False | True | | 45 s | False | True | | 55 s | False | True | The "without" column is from an earlier build of a near-identical stack (#359 and #727 in place of #432 and the others, same machine), not the same tree, so read it as the symptom and not as a paired A/B. What I did not check: dragging, minimising or closing the window, or a run past 55 s. AI-assisted: yes (Claude Code, Sonnet 5.5)
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
ProjectLeonida/mandy!526
No description provided.