message: Add bounds checks for resources in shader viewer UI
diff: @@ -2670,6 +2670,8 @@ void ShaderViewer::updateDebugState()
  BoundResourceArray &roBind = roBinds[bindIdx];
  if(bind.arraySize == 1)
  + {
  + if(!roBind.resources.empty())
  {
  RDTreeWidgetItem *node =
  new RDTreeWidgetItem({m_ShaderDetails->readOnlyResources[i].name, ro.name,
  @@ -2678,6 +2680,7 @@ void ShaderViewer::updateDebugState()
  VariableTag(DebugVariableReference(DebugVariableType::ReadOnlyResource, ro.name))));
  ui->constants->addTopLevelItem(node);
  }
  + }
  else if(bind.arraySize == ~0U)
  {
  RDTreeWidgetItem *node = new RDTreeWidgetItem(
  @@ -2738,6 +2741,8 @@ void ShaderViewer::updateDebugState()
  BoundResourceArray &rwBind = rwBinds[bindIdx];
  if(bind.arraySize == 1)
  + {
  + if(!rwBind.resources.empty())
  {
  RDTreeWidgetItem *node =
  new RDTreeWidgetItem({m_ShaderDetails->readWriteResources[i].name, rw.name,
  @@ -2746,6 +2751,7 @@ void ShaderViewer::updateDebugState()
  VariableTag(DebugVariableReference(DebugVariableType::ReadWriteResource, rw.name))));
  ui->constants->addTopLevelItem(node);
  }
  + }
  else if(bind.arraySize == ~0U)
  {
  RDTreeWidgetItem *node = new RDTreeWidgetItem(
  @@ -2806,6 +2812,8 @@ void ShaderViewer::updateDebugState()
  BoundResourceArray sampBind = samplers[bindIdx];
  if(bind.arraySize == 1)
  + {
  + if(!sampBind.resources.empty())
  {
  RDTreeWidgetItem *node =
  new RDTreeWidgetItem({m_ShaderDetails->samplers[i].name, s.name, lit("Sampler"),
  @@ -2814,6 +2822,7 @@ void ShaderViewer::updateDebugState()
  VariableTag(DebugVariableReference(DebugVariableType::Sampler, s.name))));
  ui->constants->addTopLevelItem(node);
  }
  + }
  else if(bind.arraySize == ~0U)
  {
  RDTreeWidgetItem *node = new RDTreeWidgetItem(
  @@ -3306,6 +3315,7 @@ RDTreeWidgetItem *ShaderViewer::makeSourceVariableNode(const SourceVariableMappi
  if(bind.arraySize == 1)
  {
  + if(!res.resources.empty())
  value = samplerRep(bind, ~0U, res.resources[0].resourceId);
  }
  else if(bind.arraySize == ~0U)
  @@ -3361,6 +3371,7 @@ RDTreeWidgetItem *ShaderViewer::makeSourceVariableNode(const SourceVariableMappi
  BoundResourceArray &res = resList[bindIdx];
  if(bind.arraySize == 1)
  {
  + if(!res.resources.empty())
  value = ToQStr(res.resources[0].resourceId);
  }
  else if(bind.arraySize == ~0U)
  