fix(vk): reclaim retired FSR 3.1 images after switching upscalers #2697

Open
github-sync wants to merge 1 commit from github/pr/2697 into main
Owner

@Arkex-ai opened this pull request on GitHub · 2026-11-12 06:48 UTC · original

Summary

After switching away from AMD FSR 3.1, its internal Vulkan images can remain in the retired list beyond GPU completion: the final engine release may run before the timeline completes, and retired images are otherwise drained only on a later FSR 3.1 call. This change reclaims completed retirements during subsequent presents without restarting FSR 3.1.

This is a source-proven resource-lifetime path, not a measured RX 6750 XT VRAM reduction. Refs #995.

Technical changes

  • Add a non-blocking FSR 3.1 retired-image collection entry point, skipping work when the retirement list is empty.
  • Call it once per present while holding the existing Vulkan replay lock. Images and their views are destroyed only after the real GPU completion value reaches their retirement timeline value; in-flight images remain intact.
  • Extend the native GPU-submission retirement test with an idle-after-switch scenario: 100 CPU frames cannot free an in-flight image, then actual timeline completion frees it exactly once. Verify the collection call occurs under the replay lock before the new recording.
  • On Windows, retry removing just the test's own temporary executable directory when the OS briefly holds a just-exited binary.

Validation

  • Source base: NotRexed/Hookshot main c544828ff2.
  • Tested change HEAD: 8f8c950f44.
  • Windows llvm-mingw Clang 23.1.5, Vulkan 1.4.345 headers: 29/29 native FSR 3.1/FSR 3 FI retirement scenarios pass, including the new idle-after-switch case.
  • Syntax-only compilation of production gpu/vk/vk_fsr3.cpp and gpu/vk/vk_replay.cpp passes with the Vulkan renderer's include configuration.
  • Negative regression: before the production change, the added source/behavior test fails because post-switch idle collection is absent.
  • Not tested: full-game Windows AMD play, a VRAM-before/after A/B, Linux build/runtime, or frame-time effects. No hardware leak fix or performance gain is claimed. The standalone FSR 3.1 live-image lifetime when its selection turns off is outside this patch.

Assisted-by: GPT-6

> [@Arkex-ai](https://github.com/Arkex-ai) opened this pull request on GitHub · 2026-11-12 06:48 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2697) ## Summary After switching away from AMD FSR 3.1, its internal Vulkan images can remain in the retired list beyond GPU completion: the final engine release may run before the timeline completes, and retired images are otherwise drained only on a later FSR 3.1 call. This change reclaims completed retirements during subsequent presents without restarting FSR 3.1. This is a source-proven resource-lifetime path, not a measured RX 6750 XT VRAM reduction. Refs #995. ## Technical changes - Add a non-blocking FSR 3.1 retired-image collection entry point, skipping work when the retirement list is empty. - Call it once per present while holding the existing Vulkan replay lock. Images and their views are destroyed only after the real GPU completion value reaches their retirement timeline value; in-flight images remain intact. - Extend the native GPU-submission retirement test with an idle-after-switch scenario: 100 CPU frames cannot free an in-flight image, then actual timeline completion frees it exactly once. Verify the collection call occurs under the replay lock before the new recording. - On Windows, retry removing just the test's own temporary executable directory when the OS briefly holds a just-exited binary. ## Validation - Source base: NotRexed/Hookshot main c544828ff2d545829505cd894bb7968c7c2c5fcb. - Tested change HEAD: 8f8c950f441589d081bab1ee564c7b9e83563ff3. - Windows llvm-mingw Clang 23.1.5, Vulkan 1.4.345 headers: 29/29 native FSR 3.1/FSR 3 FI retirement scenarios pass, including the new idle-after-switch case. - Syntax-only compilation of production gpu/vk/vk_fsr3.cpp and gpu/vk/vk_replay.cpp passes with the Vulkan renderer's include configuration. - Negative regression: before the production change, the added source/behavior test fails because post-switch idle collection is absent. - Not tested: full-game Windows AMD play, a VRAM-before/after A/B, Linux build/runtime, or frame-time effects. No hardware leak fix or performance gain is claimed. The standalone FSR 3.1 live-image lifetime when its selection turns off is outside this patch. Assisted-by: GPT-6 <!-- github-sync:item:2697 -->
Drain the FSR 3.1 image retirement queue on present even after the engine stops rendering. Only destroy when the Vulkan timeline confirms completion; keep GPU-in-flight images intact. Cover idle-after-switch with the native retirement fixture, including Windows test-executable cleanup.

Assisted-by: GPT-6
Commenting is not possible because the repository is archived.
No description provided.