Skip to content

Commit

Permalink
VulkanDevice: Fix crash on SW renderer switch
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Dec 8, 2023
1 parent 8960cd6 commit bc2c296
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/util/vulkan_texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit bc2c296

Please sign in to comment.