From b28428cdf1abd239e658d2366dde947aa128ddd1 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 12 Oct 2015 11:28:05 +0200 Subject: [PATCH] Don't try and index into a descriptor set or binding that doesn't exist * This can happen with unused binds - I think it's valid for a bind in a shader to index outside of the descriptor set as long as it's never used. --- .../Windows/PipelineState/VulkanPipelineStateViewer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/renderdocui/Windows/PipelineState/VulkanPipelineStateViewer.cs b/renderdocui/Windows/PipelineState/VulkanPipelineStateViewer.cs index 70d7ab0ca..f88f08d87 100644 --- a/renderdocui/Windows/PipelineState/VulkanPipelineStateViewer.cs +++ b/renderdocui/Windows/PipelineState/VulkanPipelineStateViewer.cs @@ -235,8 +235,11 @@ namespace renderdocui.Windows.PipelineState { BindpointMap bindMap = stage.BindpointMapping.Resources[shaderRes.bindPoint]; + var descriptorBind = new VulkanPipelineState.Pipeline.DescriptorSet.DescriptorBinding.BindingElement(); + // TODO do we need to worry about arrays of uniform buffers? - var descriptorBind = pipe.DescSets[bindMap.bindset].bindings[bindMap.bind].binds[0]; + if(bindMap.bindset < pipe.DescSets.Length && bindMap.bind < pipe.DescSets[bindMap.bindset].bindings.Length) + descriptorBind = pipe.DescSets[bindMap.bindset].bindings[bindMap.bind].binds[0]; bool filledSlot = (descriptorBind.res != ResourceId.Null); bool usedSlot = bindMap.used;