summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/TextureCache.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@users.noreply.github.com>2016-12-01 12:38:31 +1000
committerGitHub <noreply@github.com>2016-12-01 12:38:31 +1000
commite2018f22085dd168b8ef6ec1c8ff6260e8c3e8b2 (patch)
tree913af0e2da3f35154c7aa06af0bb6421546543b4 /Source/Core/VideoBackends/Vulkan/TextureCache.cpp
parenta3d2dead76f9fe46163a20f6b7cc6ac7b2b66f29 (diff)
parentca691a9d95c437334cfeb8321a544ed36d17849b (diff)
Merge pull request #4480 from stenzek/vulkan-streambuffer-reuse
Vulkan: Fix stream buffer re-use problems
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/TextureCache.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/TextureCache.cpp10
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())