From 198ab2b714a482e624e2ac2d82cbde8f9f8a64c4 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 29 Oct 2015 16:29:37 +0100 Subject: [PATCH] Check descriptor sets are in range when iterating layout, warn otherwise --- renderdoc/driver/vulkan/vk_core.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index 734de34da..942a986e2 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -1789,7 +1789,7 @@ void WrappedVulkan::ReplayLog(uint32_t frameID, uint32_t startEventID, uint32_t { const DescSetLayout &descLayout = m_CreationInfo.m_DescSetLayout[ descSetLayouts[i] ]; - if(s.graphics.descSets[i] != ResourceId()) + if(i < s.graphics.descSets.size() && s.graphics.descSets[i] != ResourceId()) { // if there are dynamic buffers, pass along the offsets ObjDisp(cmd)->CmdBindDescriptorSets(Unwrap(cmd), VK_PIPELINE_BIND_POINT_GRAPHICS, Unwrap(layout), (uint32_t)i, @@ -1798,7 +1798,7 @@ void WrappedVulkan::ReplayLog(uint32_t frameID, uint32_t startEventID, uint32_t } else { - RDCERR("Descriptor set is not bound but pipeline layout expects one"); + RDCWARN("Descriptor set is not bound but pipeline layout expects one"); } } }