vulkan: initialize presentation upscaling independently of frame generation #417

Merged
monsterlag merged 3 commits from fix/upscale-without-framegen into main 2026-11-08 05:20:57 +00:00
monsterlag commented 2026-11-08 00:24:31 +00:00 (Migrated from github.com)

Upscaling and Sharpness silently stop working when Frame generation is Off. Forward the direct-present sampled view under the replay lock and initialize the scaler independently, so Catmull-Rom, Lanczos and sharpening work without interpolation's copy/luma work, frame sets or display thread.

The scaler has independent initialization/failure state and rejects invalid crop/destination sizes. Partial allocation failure clears stale size metadata and falls back to the existing blit. No renderer API, aspect policy, decoder or game-generation change is included.

The branch normally merges upstream e40306e. It preserves all three upstream queue flushes before interpolation/scaler resize waits, including locked flushes before both scaler idle waits.

Validation:

  • Actual production initializer/scaler functions compile with authored API spies. Catmull, Lanczos, sharpness-only, both frame-generation environment states, all-off, cached initialization failure/cleanup, allocation failure/recovery and crop clamping/recovery pass. The spies check locked flush ordering before resize waits. These checks also passed with the new official bundled GNU Clang23.1.5 toolchain.
  • The original production scaler fails the first FG-off dispatch assertion at runtime. This negative was local; Linux CI runs both environment configurations against the fix.
  • Existing frame-generation-off gate checks pass. Direct-view forwarding/age bookkeeping has an explicitly source-based wiring check; the spy fixture does not establish GPU lifetime safety.
  • All four CI jobs pass at ad725a9: Windows/Linux source checks, SPIR-V fixture and Linux AppImage renderer build.
  • A fresh normal lift and complete matching Windows host/API4 renderer build using the no-visual-studio release toolkit passed in 992 seconds with zero failures. This live candidate combines this branch and #205 on e40306e; API4 belongs to #205.
  • RTX5090/Windows, isolated checkpoint, 100% game resolution: actual 3840x1080 and 5120x1440 windows each display the Kokiri scene/HUD with Catmull and Lanczos, FG off. Lanczos cases explicitly set RX_VK_FRAMEGEN=0. Successful-dispatch diagnostics confirm requested modes and centered 1920x1080/2560x1440 destinations; interpolation does not initialize.
  • Sharpness-only (mode0/sharpness30/FG off) and Catmull/FG2 also dispatch and display correctly. The 3840x1080 Catmull/FG-off case preserves the scene through actual 5120x2160 fullscreen and back. All six sessions close normally.

Opt into RX_VK_UPSCALE_LOG=1 to log the first successful scale dispatch's mode, sharpness, source, requested crop and destination once.

These are compatibility checks, not native60+FPS evidence: warm gameplay was roughly 48-52FPS at 100% resolution. The first cold run sustained 11.6-11.8FPS after shader jobs completed, recovering to 46-50FPS after F11; that separate readback-wait anomaly remains unexplained and is not retroactively passed.

Physical32:9 fullscreen, the reporter's RTX4070, AMD/Intel/Linux runtime, wider progression and physical audio/controller behavior remain unverified. This fixes the established FG-off bypass; no reported black-screen fix is claimed. The sampled view retains the cached image's existing retirement policy; a later presentation-fence ownership model and aggressive eviction overrides remain outside this change.

Upscaling and Sharpness silently stop working when Frame generation is Off. Forward the direct-present sampled view under the replay lock and initialize the scaler independently, so Catmull-Rom, Lanczos and sharpening work without interpolation's copy/luma work, frame sets or display thread. The scaler has independent initialization/failure state and rejects invalid crop/destination sizes. Partial allocation failure clears stale size metadata and falls back to the existing blit. No renderer API, aspect policy, decoder or game-generation change is included. The branch normally merges upstream e40306e. It preserves all three upstream queue flushes before interpolation/scaler resize waits, including locked flushes before both scaler idle waits. Validation: - Actual production initializer/scaler functions compile with authored API spies. Catmull, Lanczos, sharpness-only, both frame-generation environment states, all-off, cached initialization failure/cleanup, allocation failure/recovery and crop clamping/recovery pass. The spies check locked flush ordering before resize waits. These checks also passed with the new official bundled GNU Clang23.1.5 toolchain. - The original production scaler fails the first FG-off dispatch assertion at runtime. This negative was local; Linux CI runs both environment configurations against the fix. - Existing frame-generation-off gate checks pass. Direct-view forwarding/age bookkeeping has an explicitly source-based wiring check; the spy fixture does not establish GPU lifetime safety. - All four CI jobs pass at ad725a9: Windows/Linux source checks, SPIR-V fixture and Linux AppImage renderer build. - A fresh normal lift and complete matching Windows host/API4 renderer build using the no-visual-studio release toolkit passed in 992 seconds with zero failures. This live candidate combines this branch and #205 on e40306e; API4 belongs to #205. - RTX5090/Windows, isolated checkpoint, 100% game resolution: actual 3840x1080 and 5120x1440 windows each display the Kokiri scene/HUD with Catmull and Lanczos, FG off. Lanczos cases explicitly set RX_VK_FRAMEGEN=0. Successful-dispatch diagnostics confirm requested modes and centered 1920x1080/2560x1440 destinations; interpolation does not initialize. - Sharpness-only (mode0/sharpness30/FG off) and Catmull/FG2 also dispatch and display correctly. The 3840x1080 Catmull/FG-off case preserves the scene through actual 5120x2160 fullscreen and back. All six sessions close normally. Opt into RX_VK_UPSCALE_LOG=1 to log the first successful scale dispatch's mode, sharpness, source, requested crop and destination once. These are compatibility checks, not native60+FPS evidence: warm gameplay was roughly 48-52FPS at 100% resolution. The first cold run sustained 11.6-11.8FPS after shader jobs completed, recovering to 46-50FPS after F11; that separate readback-wait anomaly remains unexplained and is not retroactively passed. Physical32:9 fullscreen, the reporter's RTX4070, AMD/Intel/Linux runtime, wider progression and physical audio/controller behavior remain unverified. This fixes the established FG-off bypass; no reported black-screen fix is claimed. The sampled view retains the cached image's existing retirement policy; a later presentation-fence ownership model and aggressive eviction overrides remain outside this change.
Commenting is not possible because the repository is archived.
No description provided.