GPU: present to the title's stand-in window, not Windows Terminal's empty console window #3718
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3718"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-28T10:49:07Z.
Two commits on
main63bcca4: the fix, and a test commit by @andrewpozdnakov7-jpg that checks the swap chain the presenter makes is bound to the window chosen. Claimed in #1633 (claim).What
title_window()(crates/victory-gpu/src/host.rs) took the first visible top-level window of the process. Started by Windows Terminal as the first process of a new console (a double-click with Terminal as the default console host,wt victory.exe, or a launcher that makes a new console), this process also owns Terminal'sPseudoConsoleWindow. Terminal shows that window, with an empty client area, and keeps it above the title's window whenever Terminal is in front. So the presenter can make its swap chain for that window and leave the title's window white.It now prefers the visible window of class
VIctory.title, the stand-inmake_stand_inshows for the title's window (victory-hle/src/modules/lifecycle.rs:312-320). Failing that, it takes the first visible window, in z-order, with a client area. The title's own top-level window is message-only (lifecycle.rs:140,:181), soEnumWindowsnever sees it.trustno1-coder/VIctory-NVIDIA fixed the same symptom in
3f054e467. Their fix prefers the window markedvictory.wndproc; on main that window is message-only, so it would not match here. The code here is written separately.Measured (Windows 11 26100)
A probe process lists its own top-level windows after it makes a 640x480 window:
GetConsoleWindowPseudoConsoleWindow, owned by this processCreatePseudoConsolePseudoConsoleWindow, owned by this processSo only Windows Terminal shows the window. A bare pseudoconsole doesn't, and a VIctory started from a shell doesn't own one.
Tested
RTX 3070, driver 616.56, Windows 11 Pro 10.0.26100, debug.
New tests
host::title_window_tests, 3 of 3 runs. Each test first checks that the decoy really is above the window it expects:an_empty_window_above_the_titles_is_passed_over: a visible 0x0 popup above a 64x64 one;the_stand_in_wins_over_other_windows_above_it: a 64x64 window above aVIctory.titlewindow.With main's
title_window()and these tests, both fail (the decoy is returned).With the test commit (
3d0e177), the two tests also create a swap chain through the presenter and checkGetHwnd(): 3 of 3 on the 3070 (no skip, so on the hardware device).cargo test --locked -p victory-gpu --lib: 231 passed, 2 failed, 1 ignored;main63bcca4: 229 passed, 2 failed, 1 ignored. The same two failures on both:dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views, from the capped view heap on this card.cargo clippy --workspace --all-targets --locked -- -D warnings, also with--all-features: clean.cargo run -p xtask -- policy: ok.Not tested
The title itself (no game data here), and a launcher that keeps its own console hidden.
AI use
Claude Code (Claude Opus 5.5) found the trigger with the probe above, wrote the fix and the tests, and ran everything listed.
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T11:35:04Z.
I checked the actual DXGI binding on your exact
e556203. Test commit4143ffcextends both window fixtures to create a swap chain with the production presenter and compare itsGetHwnd()result with the expected window. The zero-area popup stayed above the default window in one fixture. A normal-size decoy stayed above theVIctory.titlestand-in in the other.Both bindings and the existing PresentX fallback exercise passed together in eight separate Windows WARP processes with three test threads. The tests that create presentation windows share a test-only lock. With the original selector substituted, the stand-in case failed the actual swap-chain HWND assertion. Both strict GPU Clippy configurations and the asset policy passed. These runs used generated popup windows.
@upipibi, the test is ready to cherry-pick if you want this coverage. Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding it into your commit.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-28T11:36:50Z.
@andrewpozdnakov7-jpg Thanks, it's in as
3d0e177, with you as the author. On the RTX 3070 (616.56) both tests create the swap chain on the hardware device (no skip line) and pass 3 of 3.victory-gpulib is unchanged at 231 passed, 2 failed (the two known capped-heap tests), 1 ignored, and clippy is clean.Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T19:20:41Z.
I checked
3d0e177together with the packed-float presentation change from #3784. Combined 169cc3e preserves the two exact PR heads. Both groups of presenter tests now share this PR's window lock.The stand-in test created real RGBA8 and FP16 DXGI swap chains and checked that both bind to the stand-in with a different window above it. The packed-float test checked all 5,120 readback pixels across five frames. Both window tests and both presenter tests passed in six separate Windows WARP runs with four test threads. Strict all-feature GPU Clippy and the asset policy passed.
This is ready for maintainer review or an integration pick if the two PRs land together. Please retain the Git authors on cherry-pick or rebase.
AI-assisted with OpenAI Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.