From 878c0c9ff17bf5db1fb2aa43cf30562e48175941 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 3 Sep 2018 13:41:20 +0100 Subject: [PATCH] Use immutable samplers when checking for validity * Fortunately the sampler element in the write is ignored when doing the actual update so it's safe to write these in before the validity check. --- renderdoc/driver/vulkan/vk_initstate.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/renderdoc/driver/vulkan/vk_initstate.cpp b/renderdoc/driver/vulkan/vk_initstate.cpp index 2aa2de2c6..3a733b989 100644 --- a/renderdoc/driver/vulkan/vk_initstate.cpp +++ b/renderdoc/driver/vulkan/vk_initstate.cpp @@ -708,6 +708,8 @@ bool WrappedVulkan::Serialise_InitialState(SerialiserType &ser, ResourceId id, W uint32_t descriptorCount = layout.bindings[j].descriptorCount; + ResourceId *immutableSamplers = layout.bindings[j].immutableSampler; + DescriptorSetSlot *src = srcData; srcData += descriptorCount; @@ -753,6 +755,13 @@ bool WrappedVulkan::Serialise_InitialState(SerialiserType &ser, ResourceId id, W for(uint32_t d = 0; d < descriptorCount; d++) dstImage[d] = src[d].imageInfo; + if(immutableSamplers) + { + for(uint32_t d = 0; d < descriptorCount; d++) + dstImage[d].sampler = + GetResourceManager()->GetCurrentHandle(immutableSamplers[d]); + } + writes[bind].pImageInfo = dstImage; // NULL the others dstBuffer = NULL;