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.
This commit is contained in:
baldurk
2015-10-12 11:28:05 +02:00
parent 2b9c3118a5
commit b28428cdf1
@@ -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;