summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/TextureCache.cpp
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2017-06-12 22:15:12 -0700
committerGitHub <noreply@github.com>2017-06-12 22:15:12 -0700
commit77c0539b5ed87ddfdb0d0c53e8db0172254ac13e (patch)
treed4ca8c95aa8ceb70eb569e73929c78f34bb02624 /Source/Core/VideoBackends/Vulkan/TextureCache.cpp
parent73be0258478392d901bf801d9faba7f756110ba5 (diff)
parent8a56ef42dcf4876c22651bf9a7a5b3ddd4416c5c (diff)
Merge pull request #5605 from stenzek/vulkan-imagelayout-assert
Vulkan: Fix image layout assertion failing for palette textures
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/TextureCache.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/TextureCache.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp
index 6f6e46fff9..737a05c280 100644
--- a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp
+++ b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp
@@ -87,6 +87,12 @@ void TextureCache::ConvertTexture(TCacheEntryBase* base_entry, TCacheEntryBase*
TCacheEntry* unconverted = static_cast<TCacheEntry*>(base_unconverted);
m_texture_converter->ConvertTexture(entry, unconverted, m_render_pass, palette, format);
+
+ // Ensure both textures remain in the SHADER_READ_ONLY layout so they can be bound.
+ unconverted->GetTexture()->TransitionToLayout(g_command_buffer_mgr->GetCurrentCommandBuffer(),
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
+ entry->GetTexture()->TransitionToLayout(g_command_buffer_mgr->GetCurrentCommandBuffer(),
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
}
void TextureCache::CopyEFB(u8* dst, const EFBCopyFormat& format, u32 native_width,
@@ -140,6 +146,12 @@ void TextureCache::CopyRectangleFromTexture(TCacheEntry* dst_texture,
CopyTextureRectangle(dst_texture, dst_rect, src_texture, src_rect);
else
ScaleTextureRectangle(dst_texture, dst_rect, src_texture, src_rect);
+
+ // Ensure both textures remain in the SHADER_READ_ONLY layout so they can be bound.
+ src_texture->TransitionToLayout(g_command_buffer_mgr->GetCurrentCommandBuffer(),
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
+ dst_texture->GetTexture()->TransitionToLayout(g_command_buffer_mgr->GetCurrentCommandBuffer(),
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
}
bool TextureCache::SupportsGPUTextureDecode(TextureFormat format, TlutFormat palette_format)