diff options
| author | Stenzek <stenzek@users.noreply.github.com> | 2016-10-05 20:24:36 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-05 20:24:36 +1000 |
| commit | abb5a64919f0425db5f282803eda43b764282482 (patch) | |
| tree | 442dde64153a56e29cd38955b04e86116331fc9f /Source/Core/VideoBackends/Vulkan/TextureCache.cpp | |
| parent | ef1bfc26b2f109e650b40f7b88275832366cc12b (diff) | |
| parent | db09c05eecac461f33751c824546d12a46173945 (diff) | |
Merge pull request #4295 from stenzek/vulkan-dbz-bloom
Vulkan: Fix bug with palette converted EFB copies
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/TextureCache.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/TextureCache.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp index 4b83a76b59..1a882716ce 100644 --- a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp +++ b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp @@ -92,9 +92,26 @@ void TextureCache::ConvertTexture(TCacheEntryBase* base_entry, TCacheEntryBase* TCacheEntry* unconverted = static_cast<TCacheEntry*>(base_unconverted); _assert_(entry->config.rendertarget); + // EFB copies can be used as paletted textures as well. For these, we can't assume them to be + // contain the correct data before the frame begins (when the init command buffer is executed), + // so we must convert them at the appropriate time, during the drawing command buffer. + VkCommandBuffer command_buffer; + if (unconverted->IsEfbCopy()) + { + command_buffer = g_command_buffer_mgr->GetCurrentCommandBuffer(); + m_state_tracker->EndRenderPass(); + m_state_tracker->SetPendingRebind(); + } + else + { + // Use initialization command buffer and perform conversion before the drawing commands. + command_buffer = g_command_buffer_mgr->GetCurrentInitCommandBuffer(); + } + m_palette_texture_converter->ConvertTexture( - m_state_tracker, GetRenderPassForTextureUpdate(entry->GetTexture()), entry->GetFramebuffer(), - unconverted->GetTexture(), entry->config.width, entry->config.height, palette, format); + m_state_tracker, command_buffer, GetRenderPassForTextureUpdate(entry->GetTexture()), + entry->GetFramebuffer(), unconverted->GetTexture(), entry->config.width, entry->config.height, + palette, format); // Render pass transitions to SHADER_READ_ONLY. entry->GetTexture()->OverrideImageLayout(VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); |
