Browse Source

Fix issues when resizing.

master
Draklaw 4 years ago
parent
commit
6eeb4f6f96
  1. 5
      src/Vulkan/Context.cpp
  2. 8
      src/Vulkan/Swapchain.cpp

5
src/Vulkan/Context.cpp

@ -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;

8
src/Vulkan/Swapchain.cpp

@ -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;
}

Loading…
Cancel
Save