message: Fix fetching vulkan vertex buffers when bindings are sparse
diff: @@ -594,16 +594,24 @@ rdcarray<BoundVBuffer> PipeState::GetVBuffers() const
  }
  else if(IsCaptureVK())
  {
  - ret.resize(m_Vulkan->vertexInput.bindings.count());
  - for(int i = 0; i < m_Vulkan->vertexInput.bindings.count(); i++)
  - {
  - ret[i].resourceId = i < m_Vulkan->vertexInput.vertexBuffers.count()
  - ? m_Vulkan->vertexInput.vertexBuffers[i].resourceId
  - : ResourceId();
  - ret[i].byteOffset = i < m_Vulkan->vertexInput.vertexBuffers.count()
  - ? m_Vulkan->vertexInput.vertexBuffers[i].byteOffset
  - : 0;
  - ret[i].byteStride = m_Vulkan->vertexInput.bindings[i].byteStride;
  + ret.resize(m_Vulkan->vertexInput.vertexBuffers.count());
  + for(int i = 0; i < m_Vulkan->vertexInput.vertexBuffers.count(); i++)
  + {
  + ret[i].resourceId = m_Vulkan->vertexInput.vertexBuffers[i].resourceId;
  + ret[i].byteOffset = m_Vulkan->vertexInput.vertexBuffers[i].byteOffset;
  + ret[i].byteStride = 0;
  +
  + // find the binding that corresponds to this VB to get the stride. Valid use suggests there
  + // should be at most 1, so stop at first result. If there are 0 then the stride is just 0
  + // (this vertex buffer is unused).
  + for(int j = 0; j < m_Vulkan->vertexInput.bindings.count(); j++)
  + {
  + if(m_Vulkan->vertexInput.bindings[j].vertexBufferBinding == (uint32_t)i)
  + {
  + ret[i].byteStride = m_Vulkan->vertexInput.bindings[j].byteStride;
  + break;
  + }
  + }
  }
  }
  }
  