Fix #138032: Vulkan: Loading minimized windows on Windows/NVIDIA
Minimized windows have the resolution of 0,0. The surface supports swapchains with this resolution, however it doesn't work and leads to crashes and UBs. This PR fixes this to use a minimum resolution of 1,1. Pull Request: https://projects.blender.org/blender/blender/pulls/138750
This commit is contained in:
@@ -882,6 +882,19 @@ GHOST_TSuccess GHOST_ContextVK::recreateSwapchain()
|
||||
}
|
||||
}
|
||||
|
||||
/* Windows/NVIDIA doesn't support creating a surface image with resolution 0,0. Minimuzed windows
|
||||
* have an extent of 0,0. Although it fits in the specs returned by
|
||||
* vkGetPhysicalDeviceSurfaceCapabilitiesKHR.
|
||||
*
|
||||
* Ref #138032
|
||||
*/
|
||||
if (m_render_extent.width == 0) {
|
||||
m_render_extent.width = 1;
|
||||
}
|
||||
if (m_render_extent.height == 0) {
|
||||
m_render_extent.height = 1;
|
||||
}
|
||||
|
||||
/* Use double buffering when using FIFO. Increasing the number of images could stall when doing
|
||||
* actions that require low latency (paint cursor, UI resizing). MAILBOX prefers triple
|
||||
* buffering. */
|
||||
|
||||
Reference in New Issue
Block a user