From 6d89d451cdda5ced84afde410379ff3b7fa7ce52 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 26 Jun 2017 10:53:42 +0100 Subject: [PATCH] Switch orders of depth and stencil copies when restoring D/S 'MS' arrays * This was previously needed to be stencil-before-depth to workaround an nvidia driver bug, but now depth-before-stencil works around a RADV hang and it no longer seems to be necessary for nvidia. * The RADV issue is being fixed upstream but this is a 'free' workaround until that arrives. --- renderdoc/driver/vulkan/vk_initstate.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/renderdoc/driver/vulkan/vk_initstate.cpp b/renderdoc/driver/vulkan/vk_initstate.cpp index 648a4debd..57c684993 100644 --- a/renderdoc/driver/vulkan/vk_initstate.cpp +++ b/renderdoc/driver/vulkan/vk_initstate.cpp @@ -1849,15 +1849,15 @@ bool WrappedVulkan::Serialise_InitialState(ResourceId resid, WrappedVkRes *) } } + ObjDisp(cmd)->CmdCopyBufferToImage(Unwrap(cmd), Unwrap(buf), Unwrap(arrayIm), + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + (uint32_t)mainCopies.size(), &mainCopies[0]); + if(!stencilCopies.empty()) ObjDisp(cmd)->CmdCopyBufferToImage(Unwrap(cmd), Unwrap(buf), Unwrap(arrayIm), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, (uint32_t)stencilCopies.size(), &stencilCopies[0]); - ObjDisp(cmd)->CmdCopyBufferToImage(Unwrap(cmd), Unwrap(buf), Unwrap(arrayIm), - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - (uint32_t)mainCopies.size(), &mainCopies[0]); - // once transfers complete, get ready for copy array->ms dstimBarrier.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; dstimBarrier.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;