From 6a4eba1153b7fc858aca895f17b57dc03f089860 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 30 Nov 2016 22:34:36 +1000 Subject: 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. --- Source/Core/VideoBackends/Vulkan/TextureCache.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoBackends/Vulkan/TextureCache.cpp') 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()) -- cgit v1.2.3