From b68381598b2bc6905eb31ff879fd7eeece9443f0 Mon Sep 17 00:00:00 2001 From: Z Guan Date: Sun, 29 Jan 2023 16:51:38 +0800 Subject: [PATCH] Fix sampler-only slots with immutable samplers in vulkan shader debug --- renderdoc/driver/vulkan/vk_shaderdebug.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/vulkan/vk_shaderdebug.cpp b/renderdoc/driver/vulkan/vk_shaderdebug.cpp index b05f69a72..86c3edc19 100644 --- a/renderdoc/driver/vulkan/vk_shaderdebug.cpp +++ b/renderdoc/driver/vulkan/vk_shaderdebug.cpp @@ -254,7 +254,14 @@ public: { const DescriptorSetSlot &slot = curSlots[i]; - switch(slot.type) + // When bind layout contains immutable samplers, sampler-only slots always have type + // DescriptorSlotType::Unwritten. Treat them as sampler slots in that case. + DescriptorSlotType slotType = slot.type; + if(bindLayout.immutableSampler && + bindLayout.layoutDescType == VK_DESCRIPTOR_TYPE_SAMPLER) + slotType = DescriptorSlotType::Sampler; + + switch(slotType) { case DescriptorSlotType::Sampler: case DescriptorSlotType::CombinedImageSampler: