Fix issues when resizing.

This commit is contained in:
2022-02-15 21:25:57 +01:00
parent d37336bd5b
commit 6eeb4f6f96
2 changed files with 9 additions and 4 deletions

View File

@@ -815,6 +815,7 @@ std::optional<VkPhysicalDeviceProperties> Context::select_physical_device(
surface_formats[0];
m_present_mode = VK_PRESENT_MODE_FIFO_KHR;
// m_present_mode = VK_PRESENT_MODE_IMMEDIATE_KHR;
}
return device_properties;
@@ -955,7 +956,9 @@ VKAPI_ATTR VkBool32 VKAPI_CALL Context::log_debug_message(
stream << data->pMessage;
}
if(severity == VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT)
if(severity == VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT
&& data->messageIdNumber != 2094043421 // wrong swapchain extent
)
abort();
return VK_FALSE;

View File

@@ -249,13 +249,13 @@ void Swapchain::create() {
capabilities.maxImageExtent.height
);
}
logger.debug() << "swapchain extent: " << m_extent.width
<< ", " << m_extent.height;
// logger.debug() << "swapchain extent: " << m_extent.width
// << ", " << m_extent.height;
uint32_t image_count = capabilities.minImageCount;
if(capabilities.maxImageCount != 0)
image_count = std::min(image_count, capabilities.maxImageCount);
logger.debug() << "swapchain image count: " << image_count;
// logger.debug() << "swapchain image count: " << image_count;
bool share_image = m_queue_families.size() > 1;
@@ -389,6 +389,8 @@ void Swapchain::recreate() {
destroy();
create();
m_invalid = false;
}