From ae02e05e4b601223f6ea2d1b6bf73cedfad482d9 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Tue, 3 Jan 2023 03:50:11 +0000 Subject: [PATCH] layer: Clean up return logic in QueuePresentKHR --- layer/VkLayer_FROG_gamescope_wsi.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/layer/VkLayer_FROG_gamescope_wsi.cpp b/layer/VkLayer_FROG_gamescope_wsi.cpp index 15f89bc..fb6f060 100644 --- a/layer/VkLayer_FROG_gamescope_wsi.cpp +++ b/layer/VkLayer_FROG_gamescope_wsi.cpp @@ -590,9 +590,11 @@ namespace GamescopeWSILayer { } VkResult result = pDispatch->QueuePresentKHR(queue, pPresentInfo); - if (forceSuboptimal && result == VK_SUCCESS) - return VK_SUBOPTIMAL_KHR; - return result; + + if (result != VK_SUCCESS) + return result; + + return forceSuboptimal ? VK_SUBOPTIMAL_KHR : VK_SUCCESS; } static void SetHdrMetadataEXT(