summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/StateTracker.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2019-03-17 16:46:41 +1000
committerStenzek <stenzek@gmail.com>2019-03-29 20:54:44 +1000
commit23a655217c425fcb8bce2cf9c94e770f45f198c6 (patch)
treead95451ef7e70796567887d3e4c08400bbb71d5b /Source/Core/VideoBackends/Vulkan/StateTracker.cpp
parent087b11e780a89928ae4f6d2229eb3e79f4f0689b (diff)
Vulkan: Fix validation layer error for unbound texture layouts
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/StateTracker.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/StateTracker.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/StateTracker.cpp b/Source/Core/VideoBackends/Vulkan/StateTracker.cpp
index 6bb1b8981d..e25147cbe1 100644
--- a/Source/Core/VideoBackends/Vulkan/StateTracker.cpp
+++ b/Source/Core/VideoBackends/Vulkan/StateTracker.cpp
@@ -62,11 +62,13 @@ bool StateTracker::Initialize()
VKTexture::Create(TextureConfig(1, 1, 1, 1, 1, AbstractTextureFormat::RGBA8, 0));
if (!m_dummy_texture)
return false;
+ m_dummy_texture->TransitionToLayout(g_command_buffer_mgr->GetCurrentInitCommandBuffer(),
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
// Initialize all samplers to point by default
for (size_t i = 0; i < NUM_PIXEL_SHADER_SAMPLERS; i++)
{
- m_bindings.samplers[i].imageLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ m_bindings.samplers[i].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
m_bindings.samplers[i].imageView = m_dummy_texture->GetView();
m_bindings.samplers[i].sampler = g_object_cache->GetPointSampler();
}
@@ -223,14 +225,14 @@ void StateTracker::UnbindTexture(VkImageView view)
if (it.imageView == view)
{
it.imageView = m_dummy_texture->GetView();
- it.imageLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ it.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
}
}
if (m_bindings.image_texture.imageView == view)
{
m_bindings.image_texture.imageView = m_dummy_texture->GetView();
- m_bindings.image_texture.imageLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ m_bindings.image_texture.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
}
}