From 672fbb84d868b6b9efebe227650058a6eec2198a Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 15 May 2020 11:23:26 +0100 Subject: [PATCH] Sanitise image layouts in pixel history --- renderdoc/driver/vulkan/vk_pixelhistory.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/renderdoc/driver/vulkan/vk_pixelhistory.cpp b/renderdoc/driver/vulkan/vk_pixelhistory.cpp index b109a2c94..20900688e 100644 --- a/renderdoc/driver/vulkan/vk_pixelhistory.cpp +++ b/renderdoc/driver/vulkan/vk_pixelhistory.cpp @@ -2765,16 +2765,23 @@ void CreateOcclusionPool(WrappedVulkan *vk, uint32_t poolSize, VkQueryPool *pQue VkImageLayout VulkanDebugManager::GetImageLayout(ResourceId image, VkImageAspectFlagBits aspect, uint32_t mip, uint32_t slice) { + VkImageLayout ret = VK_IMAGE_LAYOUT_UNDEFINED; + auto state = m_pDriver->FindConstImageState(image); if(!state) { RDCERR("Could not find image state for %s", ToStr(image).c_str()); - return VK_IMAGE_LAYOUT_UNDEFINED; + return ret; } + if(state->GetImageInfo().extent.depth > 1) - return state->GetImageLayout(aspect, mip, 0); + ret = state->GetImageLayout(aspect, mip, 0); else - return state->GetImageLayout(aspect, mip, slice); + ret = state->GetImageLayout(aspect, mip, slice); + + SanitiseReplayImageLayout(ret); + + return ret; } void UpdateTestsFailed(const TestsFailedCallback *tfCb, uint32_t eventId, uint32_t eventFlags,