From 1a088db6ffee1403bfcda55d6249d354418971a9 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 11 Feb 2020 11:48:38 +0000 Subject: [PATCH] Don't try to clear block/YUV textures for vulkan initial states --- renderdoc/driver/vulkan/vk_initstate.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/renderdoc/driver/vulkan/vk_initstate.cpp b/renderdoc/driver/vulkan/vk_initstate.cpp index e398405f1..3af5b2825 100644 --- a/renderdoc/driver/vulkan/vk_initstate.cpp +++ b/renderdoc/driver/vulkan/vk_initstate.cpp @@ -1641,10 +1641,10 @@ void WrappedVulkan::Apply_InitialState(WrappedVkRes *live, const VkInitialConten { initReq = state->MaxInitReq(range, policy, initialized); } - if(initReq == eInitReq_Copy) + + // you can't clear YUV textures, so force them to be copied either way + if(initReq == eInitReq_Copy || initReq == eInitReq_Clear) copyRegions.push_back(region); - else if(initReq == eInitReq_Clear) - clearRegions.push_back(range); } } else if(IsDepthAndStencilFormat(fmt)) @@ -1706,7 +1706,10 @@ void WrappedVulkan::Apply_InitialState(WrappedVkRes *live, const VkInitialConten { initReq = state->MaxInitReq(range, policy, initialized); } - if(initReq == eInitReq_Copy) + + // you can't clear compressed textures, so fall back to copying them + if(initReq == eInitReq_Copy || + (IsBlockFormat(imageInfo.format) && initReq == eInitReq_Clear)) copyRegions.push_back(region); else if(initReq == eInitReq_Clear) clearRegions.push_back(range);