fix(vk): keep Windows Vulkan presentation compatible with Streamline #2275
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2275
Loading…
Reference in a new issue
No description provided.
Delete branch "stoome/Longshot:fix/vulkan-streamline-compat"
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?
Summary
On Windows, Vulkan shims can intercept the executable’s loader imports while missing calls made directly by the renderer DLL. Streamline 2.14.16 can also submit a null signal semaphore on a fence-only image acquire and release its old swapchain images while creating their replacement. These three paths can leave MFG Unlocker’s device unprepared, crash a frame acquire, or lose the device when the frame-generation setting changes.
To reproduce with the affected setup, use native Vulkan with OptiScaler
v10.0.0-pre1_20261111, MFG Unlocker 1.7.1, and stock Streamline 2.14.16. Under[FrameGen], setEnabled=true,FGInput=DLSSG,FGOutput=DLSSG, andFGNvngxReplacement=MFGUnlocker. Enter gameplay with DLSS frame generation, select 2×, switch to 6× and 5×, then turn frame generation off. The Windows loader callback,create_swapchain,present_image_with_trial, andacquire_aheadare the entry points to review.This series makes Windows resolve Vulkan through the executable, retires the old NVIDIA swapchain before entering the replacement hook, and supplies and consumes an acquire semaphore on both Windows NVIDIA acquire paths. The CPU fence still gates the copy. Completed signals from abandoned acquires are consumed before their semaphores are reclaimed.
Testing
The submitted branch at
aa46316is based on67ba729. All seven commits in the submission checkout have the same source trees as their counterparts in the tested series ending atb694ff6.Tested: On Windows,
mainata2dc538and the patched build both compiled and linked with LLVM-MinGW. Eleven focused Clang checks and seven focused GCC checks passed on that base. The regression checks failed for the expected loader, swapchain, and acquire behavior. Mutation checks caught missing semaphore wiring in each acquire path, a missing submission wait, and disabled reclamation. The existing audio, menu text, and capture fixtures passed after updates for the new host callback and semaphore retirement. The UTF-8 paths check also passed.After rebasing onto
67ba729, the tested head atb694ff6compiled and linked again with LLVM-MinGW. All 17 focused checks passed, including the GPU architecture and device policy checks. Each regression fixture reproduced its intended failure on the rebased series before its fix. The exported seven-commit series replayed withgit am.An earlier v3.0.0 build with the compatibility fixes completed two 2× → 6× → 5× → Off cycles with OptiScaler, MFG Unlocker and stock Streamline 2.14.16. Current
mainhas a second acquire path, which this series also covers with a regression test.The author reported that MFG Unlocker worked in a manual game test on their PC. The build hash, exact multiplier sequence and provider log results are pending confirmation for that run.
On the RTX 3090 with stock Vulkan, the patched build went windowed → fullscreen → windowed on both bases. The rebased game log reported
b694ff6and showed three swapchains at 1720×720, 3440×1440 and 1720×720. Frames advanced after each change and the game quit with exit code 0.Changed-file lint and the secret scan passed. Workflow lint reports ShellCheck
SC2016at.forgejo/workflows/build-windows.yml:82on bothmainand the patch.The strict Windows suite ran on the
a2dc538base in batches with a 90-second per-check limit. Including isolated reruns, 861 checks passed onmainand 862 on the patch. Both sides had 35 failures and five timeouts in this local setup.tests/test_job_queue.pyinterrupted the runner on both sides, including in isolation. The control bridge relaunch check failed once on the patch and passed on rerun. The CRT fixture passed on a freshmaincheckout after a previous interrupted run had left its shader source modified. The full-suite checklist stays open.Failures and timeouts observed on both builds
nx2/:test_import_windows.py.tests/:test_auto_handheld.py,test_close_waits_for_save.py,test_compile_zero_byte.py,test_crash_dialog.py,test_damaged_rom_files.py,test_dev_ab.py,test_dev_build.py,test_dev_migrate.py,test_dev_packs.py,test_dev_update.py,test_draw_stream_visibility.py,test_fs_save_commit.py,test_fsr_uniform_ownership.py,test_fsr3fi_hud_layer.py,test_fsr3fi_hudless_colour.py,test_game_menu_mouse_buttons.py,test_guest_copies.py,test_hold_toggle.py,test_input_movie.py,test_linux_preflight.py,test_lower_atomg_cas.py,test_menu_i18n.py,test_menu_keys.py,test_menu_slider_ends.py,test_mise_build.py,test_pads_after_menu.py,test_perf_report.py,test_recording_admission.py,test_sampler_admission.py,test_sdiv_overflow.py,test_sim_turf_pools.py,test_switch_table.py,test_tls_objects.py, andtest_vibration_menu.py.tests/:test_cv_handoff_threads.py,test_fpxkeep.py,test_prepare_stall.py,test_recorder_sync.py, andtest_seed_reader.py.Still to test:
67ba729base. The earlier run useda2dc538.Measurements
Verdict: All three Vulkan regression fixtures reproduced their intended failures before their fixes on the
67ba729base and passed on the source tree submitted ataa46316. The earlier stock Vulkan A/B ona2dc538measured 78.2 FPS onmainand 82.2 FPS on the patch, a 5.1% increase in that run set. A stock performance comparison on the rebased head remains open.Baseline: The timing comparison used
a2dc538, the head ofmainwhen testing began. The current head at67ba729includes ASTC and device policy changes that landed during testing.Setup used
dev.py abon Windows 11 build 28000, NVIDIA RTX 3090 with driver 621.01, Kokiri Forest, 67% render resolution, and no third-party Vulkan hook. Four 15-second samples ran in A1, B1, A2, B2 order after warm-up. All four loaded gameplay and quit normally. The patched binary was built at5fc73f6.mainthen advanced to67ba729, andgit range-diffconfirmed all seven patches carried over unchanged.a2dc5385fc73f6The benchmark tool withheld its write-up because
HOS_CONTROLis a unique named pipe for every run. Reanalyzing the four captured results with only this per-run identifier excluded found no remaining differences in the benchmark's settings check. The FPS table includes cold frames, which were more frequent onmain.Regression checks
Setup: The game-free Vulkan fixtures ran on Windows with LLVM-MinGW and used the same inputs for both sides. The before measurements come from each test-only commit in the series before its corresponding fix.
67ba729aa46316ad17303shows the renderer bypassing the executable’s resolver2b756e9covers the callback, older-host fallback and missing-resolver cases0759a97shows the hook seeing the old chain before teardownf638e77retires the old chain, image views and per-image semaphores first8768856shows both acquire paths omitting the semaphore643b9a8signals it on both paths and the copy consumes it after CPU fence readinessRisks
Windows NVIDIA uses a small number of additional Vulkan synchronization objects and a different recreation order. A discarded acquire whose fence never signals retains its synchronization objects until the process exits. Retirement probes at most one such entry per successful copy. The ABI advances from 44 to 45, so build and ship the executable and renderer together. Reverting the series restores the prior behavior. Player saves and options require no migration.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.MKWVK_API_VERSIONbumped (MkwVkHostorMkwVkRendereringpu/vk/vk_api.hchanged).Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Tested in game: Windows 11 build 28000, RTX 3090, NVIDIA driver 621.01. Tested build b694ff6, which has the same committed source as submission head
aa46316. With stock Vulkan, I switched from windowed to fullscreen and back. The swapchain recreated both times, gameplay continued, and the game exited cleanly. MFG Unlocker also worked in my manual game test.WIP: fix(vk): keep Windows Vulkan presentation compatible with Streamlineto fix(vk): keep Windows Vulkan presentation compatible with Streamlinefix(vk): keep Windows Vulkan presentation compatible with Streamlineto WIP: fix(vk): keep Windows Vulkan presentation compatible with StreamlineWIP: fix(vk): keep Windows Vulkan presentation compatible with Streamlineto fix(vk): keep Windows Vulkan presentation compatible with Streamline@review
Recommendation: Approve. The code is ready: only testing is left. The submitted fixtures exercise the intended compatibility changes, but the affected injector setup still needs a confirmed run on the submitted source. Recommend approval; not approved on the forge.
The change resolves Vulkan through the Windows executable, retires NVIDIA swapchains before replacement, and supplies acquire semaphores for Streamline compatibility. It adds synchronization objects and retirement work to Windows NVIDIA presentation.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
Questions (1) (not confirmed from the code; they don't hold the recommendation)
gpu/vk/vk_replay.cpp:6264: Can vkCreateSemaphore return VK_ERROR_DEVICE_LOST repeatedly in this path while the preceding frame-fence waits continue to succeed?Checks: Still running: 9 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven in the affected setup on the submitted source: the game-free fixtures failed before their fixes and passed after them, and an earlier build completed the multiplier sequence. The reported manual MFG Unlocker run still lacks confirmation of its build and sequence. The older stock Vulkan comparison reported 78.2 FPS before and 81.0/83.4 FPS after, but does not measure the claimed compatibility fix on the current base.
Other systems: The semaphore and early-retirement paths affect Windows NVIDIA, including stock Vulkan without the injector. The host ABI changes on both platforms; Windows stock swapchain recreation was exercised, while the submitted description leaves Linux host building and AMD and Linux transition runs open.
Switches: None added, changed, or removed.
Reviewed:
aa4631676bagainst67ba729d21: Read the repository rules, standards and PR template; reviewed the production diff and synchronization callers, the changed fixture diffs and the new resolver fixture. Skimmed the larger fixture bodies and recorded runs. The requested docs/review-checklist.md and adjacent Tooling checkout were absent. Did not read the complete production files or every changed test in full.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no builds, tests, or project scripts were run. CI was still running in the supplied results.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
Jiro113 referenced this pull request2026-11-23 19:08:32 +00:00