Skip to content

Commit

Permalink
React to all errors returned by vkCreateSwapchainKHR().
Browse files Browse the repository at this point in the history
  • Loading branch information
kondrak committed Oct 14, 2020
1 parent 0710d5a commit 3b8fbff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion qcommon/qcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
6 changes: 3 additions & 3 deletions ref_vk/vk_swapchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3b8fbff

Please sign in to comment.