Closed RussellHolgate closed 2 years ago
I cannot reproduce this on Arch & X11 with the latest SDK version (1.2.140) and an NVIDIA GTX 1070.
The issue doesn't happen when maximizing or restoring the window, only when resizing by dragging the edges of the window.
I was able to fix the issue for myself by adding a delay to the beginning of the recreateSwapChain function.
void recreateSwapChain() { std::this_thread::sleep_for(800ms); //...
I've also been using the latest SDK with the XCB library and have a GTX 970.
I got the exact same problem on Ubuntu Mint 18.04 with Intel HD Graphics on a dual monitor setup. An additional problem is when I resize the window on any axis to about the third of its initial size, the primary monitor get completely black. It does not came back when the application is closed and I have to switch tty to get the display back. I still get validation errors (maybe less) with the thread sleep and still get the display crash.
@Nonoreve Anything less than 800ms didn't work for me so perhaps you need a bigger delay. You could try 10s for testing purposes.
In Manjaro Linux using X11, in "16_swap_chain_recreation.cpp", resizing the window always results in a validation error:
Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x5600db3ec300, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (746,547), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (745,546), minImageExtent = (745,546), maxImageExtent = (745,546). The Vulkan spec states: imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)
My best guess is this is a thread issue. I've tried modifying the code to add a frame limit which resulted in receiving this error only half of the time instead of every time. I also tried replacing GLFW with SDL2 but results were the same.