diff --git a/src/client/refresh/vk/header/qvk.h b/src/client/refresh/vk/header/qvk.h index 7c163c60..fb58d286 100644 --- a/src/client/refresh/vk/header/qvk.h +++ b/src/client/refresh/vk/header/qvk.h @@ -315,6 +315,7 @@ void QVk_DrawTexRect(const float *ubo, VkDeviceSize uboSize, qvktexture_t *text void QVk_BindPipeline(qvkpipeline_t *pipeline); void QVk_SubmitStagingBuffers(void); void Qvk_MemoryBarrier(VkCommandBuffer cmdBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkAccessFlags srcAccessMask, VkAccessFlags dstAccessMask); +qboolean QVk_CheckExtent(void); // debug label related functions void QVk_DebugSetObjectName(uint64_t obj, VkObjectType objType, const char *objName); diff --git a/src/client/refresh/vk/vk_swapchain.c b/src/client/refresh/vk/vk_swapchain.c index 65c7436f..2ee91dec 100644 --- a/src/client/refresh/vk/vk_swapchain.c +++ b/src/client/refresh/vk/vk_swapchain.c @@ -127,6 +127,19 @@ static VkCompositeAlphaFlagBitsKHR getSupportedCompositeAlpha(VkCompositeAlphaFl return VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR; } +qboolean QVk_CheckExtent(void) +{ + VkSurfaceCapabilitiesKHR surfaceCaps; + VK_VERIFY(vkGetPhysicalDeviceSurfaceCapabilitiesKHR(vk_device.physical, vk_surface, &surfaceCaps)); + + if (surfaceCaps.currentExtent.width == 0 || surfaceCaps.currentExtent.height == 0) + { + return false; + } + + return true; +} + VkResult QVk_CreateSwapchain() { VkSurfaceCapabilitiesKHR surfaceCaps;