mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-14 18:19:36 +01:00
Vulkan: Recreate an additional swapchain that stays suboptimal
Only out of date and a lost surface recreated one, so a TV whose mode changed without a resize (MoltenVK reports SUBOPTIMAL when the layer's size no longer matches) kept a stretched picture. Like the main swapchain, it's now recreated after a few SUBOPTIMAL presents in a row. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
22aa12d047
commit
771e40e297
3 files changed
+10
-1
No files matched your search
@@ -187,7 +187,14 @@ void FrameData::PresentExtraSwapchains(VulkanContext *vulkan) {
|
||||
VkResult res = vkQueuePresentKHR(vulkan->GetGraphicsQueue(), &present);
|
||||
if (res == VK_ERROR_OUT_OF_DATE_KHR || res == VK_ERROR_SURFACE_LOST_KHR) {
|
||||
swapchain->outOfDate = true;
|
||||
} else if (res != VK_SUCCESS && res != VK_SUBOPTIMAL_KHR) {
|
||||
} else if (res == VK_SUBOPTIMAL_KHR) {
|
||||
// Like the main swapchain, recreated once it stays that way (a TV's mode changed without a resize).
|
||||
if (++swapchain->suboptimalFrames > VulkanContext::MAX_INFLIGHT_FRAMES) {
|
||||
swapchain->outOfDate = true;
|
||||
}
|
||||
} else if (res == VK_SUCCESS) {
|
||||
swapchain->suboptimalFrames = 0;
|
||||
} else {
|
||||
ERROR_LOG(Log::G3D, "vkQueuePresentKHR failed for an additional swapchain: %s", VulkanResultToString(res));
|
||||
}
|
||||
swapchain->acquired = false;
|
||||
|
||||
Reference in new issue
Block a user