diff options
| author | Stenzek <stenzek@gmail.com> | 2016-11-30 22:34:36 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2016-11-30 23:14:36 +1000 |
| commit | 6a4eba1153b7fc858aca895f17b57dc03f089860 (patch) | |
| tree | d425d55180cc410e9c7ca157f4786f2a76a5b741 /Source/Core/VideoBackends/Vulkan/TextureCache.cpp | |
| parent | 3adeacb78d6c313020ea6f2562f76856f9431ec1 (diff) | |
Vulkan: Replace explicit command buffer submits with wrapper function
Should we ever introduce anything else that has to be done when a command
buffer is executed (e.g. invalidating constants from previous commit), we
don't have to update all the callers.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/TextureCache.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/TextureCache.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp index d52ba671db..b607a91fd0 100644 --- a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp +++ b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp @@ -145,10 +145,10 @@ void TextureCache::CopyEFB(u8* dst, u32 format, u32 native_width, u32 bytes_per_ else src_texture = FramebufferManager::GetInstance()->ResolveEFBColorTexture(region); - // End render pass before barrier (since we have no self-dependencies) + // End render pass before barrier (since we have no self-dependencies). + // The barrier has to happen after the render pass, not inside it, as we are going to be + // reading from the texture immediately afterwards. StateTracker::GetInstance()->EndRenderPass(); - StateTracker::GetInstance()->SetPendingRebind(); - StateTracker::GetInstance()->InvalidateDescriptorSets(); StateTracker::GetInstance()->OnReadback(); // Transition to shader resource before reading. @@ -666,9 +666,7 @@ bool TextureCache::TCacheEntry::Save(const std::string& filename, unsigned int l VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL); // Block until the GPU has finished copying to the staging texture. - g_command_buffer_mgr->ExecuteCommandBuffer(false, true); - StateTracker::GetInstance()->InvalidateDescriptorSets(); - StateTracker::GetInstance()->SetPendingRebind(); + Util::ExecuteCurrentCommandsAndRestoreState(false, true); // Map the staging texture so we can copy the contents out. if (staging_texture->Map()) |
