diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index adc621f16..c7420c18d 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -5457,6 +5457,15 @@ size_t WrappedVulkan::DescriptorDataSize(VkDescriptorType type) void WrappedVulkan::RegisterDescriptor(const bytebuf &key, const DescriptorSetSlot &data) { m_DescriptorLookup.fallback.insert(key, data); + + // store unique texel buffer formats used, expecting this to be small and it will help descriptor lookups + if(data.type == DescriptorSlotType::UniformTexelBuffer || + data.type == DescriptorSlotType::StorageTexelBuffer) + { + VkFormat fmt = VkFormat(data.imageLayoutOrFormat); + if(data.resource != ResourceId() && !m_DescriptorLookup.texelFormats.contains(fmt)) + m_DescriptorLookup.texelFormats.push_back(fmt); + } } bool WrappedVulkan::IsPartialRenderPassActive() diff --git a/renderdoc/driver/vulkan/vk_core.h b/renderdoc/driver/vulkan/vk_core.h index b6d1ca894..5be82437c 100644 --- a/renderdoc/driver/vulkan/vk_core.h +++ b/renderdoc/driver/vulkan/vk_core.h @@ -472,6 +472,11 @@ private: // overall lookup of all descriptors by bytes, fallback in case any others don't work - we // expect this to always hit rdcbytetrie fallback; + + // unique texel formats. So that if we fast identify a buffer via address+size we can iterate + // over all of these if we know it's a texel buffer. The expectation is this is short so we + // don't have to store this per-buffer but globally and can just try different possibilities. + rdcarray texelFormats; }; DescriptorLookups m_DescriptorLookup;