mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 15:45:42 +00:00
VulkanHostDisplay: Don't crash when headless
This commit is contained in:
parent
09c65b48b8
commit
607cb8dbb7
|
@ -355,7 +355,16 @@ bool VulkanHostDisplay::HasRenderSurface() const
|
||||||
|
|
||||||
VkRenderPass VulkanHostDisplay::GetRenderPassForDisplay() const
|
VkRenderPass VulkanHostDisplay::GetRenderPassForDisplay() const
|
||||||
{
|
{
|
||||||
|
if (m_swap_chain)
|
||||||
|
{
|
||||||
return m_swap_chain->GetClearRenderPass();
|
return m_swap_chain->GetClearRenderPass();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If we're running headless, assume RGBA8.
|
||||||
|
return g_vulkan_context->GetRenderPass(VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_UNDEFINED, VK_SAMPLE_COUNT_1_BIT,
|
||||||
|
VK_ATTACHMENT_LOAD_OP_CLEAR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VulkanHostDisplay::CreateResources()
|
bool VulkanHostDisplay::CreateResources()
|
||||||
|
|
Loading…
Reference in a new issue