mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-03-06 14:27:44 +00:00
Vulkan/SwapChain: Ensure returned height is at least 1x1
This commit is contained in:
parent
862c6998eb
commit
48bc152a63
|
@ -648,8 +648,8 @@ bool SwapChain::CreateSwapChain()
|
|||
if (old_swap_chain != VK_NULL_HANDLE)
|
||||
vkDestroySwapchainKHR(g_vulkan_context->GetDevice(), old_swap_chain, nullptr);
|
||||
|
||||
m_window_info.surface_width = size.width;
|
||||
m_window_info.surface_height = size.height;
|
||||
m_window_info.surface_width = std::max(1u, size.width);
|
||||
m_window_info.surface_height = std::max(1u, size.height);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -571,8 +571,8 @@ void CommonHostInterface::ReleaseHostDisplayResources()
|
|||
|
||||
void CommonHostInterface::OnHostDisplayResized()
|
||||
{
|
||||
const u32 new_width = m_display ? std::max<u32>(m_display->GetWindowWidth(), 1) : 0;
|
||||
const u32 new_height = m_display ? std::max<u32>(m_display->GetWindowHeight(), 1) : 0;
|
||||
const u32 new_width = m_display ? m_display->GetWindowWidth() : 0;
|
||||
const u32 new_height = m_display ? m_display->GetWindowHeight() : 0;
|
||||
const float new_scale = m_display ? m_display->GetWindowScale() : 1.0f;
|
||||
|
||||
ImGui::GetIO().DisplaySize.x = static_cast<float>(new_width);
|
||||
|
|
Loading…
Reference in a new issue