mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:10:53 +01:00
[PR #489] VK-PRESENTER-SURFACE: recover a lost presentation surface #539
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#539
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/489
Author: @bobcatchris
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:presenter-surface-recovery📝 Commits (1)
c0d7bd3present: recover a lost presentation surface📊 Changes
2 files changed (+103 additions, -28 deletions)
View changed files
📝
runtime/src/vulkan_present.h(+45 -27)📝
runtime/test/vk_presenter_sync_test.cpp(+58 -1)📄 Description
Claimed in the coordination issue as: VK-PRESENTER-SURFACE
What and why
The Xbox Vulkan presenter could lose its WSI surface during format enumeration, swapchain creation, or swapchain replacement. The old code only handled surface loss during acquire; a lost surface found during setup left the presenter unusable, and a replacement could leave later presents aimed at the old handle.
This checks the result of every surface query and swapchain creation, marks the surface lost on
VK_ERROR_SURFACE_LOST_KHR, and defers presentation until the retained recreate callback supplies a fresh surface. The presenter test injects lost startup and replacement surfaces and verifies that presentation resumes with matching pixels.Carried from the source patch and measurements by @Sigtryggur-Mani-Gudmundsson:
github.com/Sigtryggur-Mani-Gudmundsson/graphics-runtime-patches@33ab48d3ea/README.md (recovering-a-lost-presentation-surface)No game data, keys, or decryption are included.
Tested
vk_presenter_sync_testwith CMake/Ninja, RelWithDebInfo.recovered lost startup and replacement surfaces, 128x96 pixels matched.mainsource + patched test: fails atpresenter.ok(), proving the regression test catches the bug.mainsource + old test: passes, so the new failure comes from the added lost-surface cases.clang++receiving MSVC flags such as/utf-8and/W4); the targeted presenter target builds and runs cleanly.git diff --checkclean.Source report measured the same fix on an RTX 4070 Ti under Wine/XWayland with 12,288 of 12,288 pixels matching after recovery.
GPUs tested: AMD Radeon RX 7900 XTX, driver 32.0.32029.2010, Windows 11; source report used NVIDIA GeForce RTX 4070 Ti under Wine/XWayland
AI-assisted: yes
Checklist
mainand merges cleanly.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.