From 3b8fbff93e64f749bcd69cb1956878e33b8f65c8 Mon Sep 17 00:00:00 2001 From: Krzysztof Kondrak Date: Wed, 14 Oct 2020 21:37:07 +0200 Subject: [PATCH] React to all errors returned by vkCreateSwapchainKHR(). --- qcommon/qcommon.h | 2 +- ref_vk/vk_swapchain.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qcommon/qcommon.h b/qcommon/qcommon.h index 04a82626..a1182e96 100644 --- a/qcommon/qcommon.h +++ b/qcommon/qcommon.h @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define VERSION 3.21 -#define VKQUAKE2_VERSION "1.5.4" +#define VKQUAKE2_VERSION "1.5.5" #define BASEDIRNAME "baseq2" diff --git a/ref_vk/vk_swapchain.c b/ref_vk/vk_swapchain.c index e19abe93..9c6b96ab 100644 --- a/ref_vk/vk_swapchain.c +++ b/ref_vk/vk_swapchain.c @@ -231,11 +231,11 @@ VkResult QVk_CreateSwapchain() // but for some implementation-specific reason exclusive full-screen access is unavailable for the particular combination // of parameters provided. If this occurs, VK_ERROR_INITIALIZATION_FAILED will be returned." // - // Some drivers reportedly have problems here, so just disable exclusive fullscreen and try to recreate the swapchain. + // Exclusive fullscreen cannot be guaranteed, so just disable it and try to recreate the swapchain if an error occurs. #ifdef FULL_SCREEN_EXCLUSIVE_ENABLED - if (vk_config.vk_full_screen_exclusive_enabled && res == VK_ERROR_INITIALIZATION_FAILED) + if (vk_config.vk_full_screen_exclusive_enabled && res != VK_SUCCESS) { - ri.Con_Printf(PRINT_ALL, "...received VK_ERROR_INITIALIZATION_FAILED from vkCreateSwapchainKHR() - disabling fullscreen exclusive!\n"); + ri.Con_Printf(PRINT_ALL, "...received %s from vkCreateSwapchainKHR() - disabling fullscreen exclusive!\n", QVk_GetError(res)); scCreateInfo.pNext = NULL; res = vkCreateSwapchainKHR(vk_device.logical, &scCreateInfo, NULL, &vk_swapchain.sc); vk_config.vk_full_screen_exclusive_enabled = false;