VulkanDevice: Fix crash on SW renderer switch

This commit is contained in:
Stenzek 2023-12-09 01:43:59 +10:00
parent d068799515
commit 1f4a37f8eb
No known key found for this signature in database

View file

@ -221,10 +221,12 @@ VkImageLayout VulkanTexture::GetVkLayout() const
VkCommandBuffer VulkanTexture::GetCommandBufferForUpdate()
{
VulkanDevice& dev = VulkanDevice::GetInstance();
if (m_type != Type::Texture || m_use_fence_counter == dev.GetCurrentFenceCounter())
if ((m_type != Type::Texture && m_type != Type::DynamicTexture) ||
m_use_fence_counter == dev.GetCurrentFenceCounter())
{
// Console.WriteLn("Texture update within frame, can't use do beforehand");
dev.EndRenderPass();
if (dev.InRenderPass())
dev.EndRenderPass();
return dev.GetCurrentCommandBuffer();
}