diff --git a/vulkan/vulkan_swapchain.cpp b/vulkan/vulkan_swapchain.cpp index 358d642f..37563d40 100644 --- a/vulkan/vulkan_swapchain.cpp +++ b/vulkan/vulkan_swapchain.cpp @@ -124,7 +124,10 @@ bool Swapchain::create(unsigned int desired_num_swapchain_images, int new_width, else num_swapchain_images = desired_num_swapchain_images; - extents = surface_capabilities.currentExtent; + // If extents aren't reported (Wayland), we have to rely on Wayland to report + // the size, so keep current extent. + if (surface_capabilities.currentExtent.width != -1) + extents = surface_capabilities.currentExtent; uint32_t graphics_queue_index = 0; auto queue_properties = physical_device.getQueueFamilyProperties(); @@ -396,4 +399,4 @@ vk::RenderPass &Swapchain::get_render_pass() return render_pass.get(); } -} // namespace Vulkan \ No newline at end of file +} // namespace Vulkan