message: Fix GLES display of wireframe overlay for non-indexed draws
diff: @@ -373,14 +373,19 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve
  const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId);
  + std::vector<uint32_t> patchedIndices;
  +
  // readback the index buffer data
  + if(idxbuf)
  + {
  std::vector<byte> idxs;
  uint32_t offset = draw->indexOffset * draw->indexByteWidth;
  uint32_t length = 1;
  drv.glGetNamedBufferParameterivEXT(idxbuf, eGL_BUFFER_SIZE, (GLint *)&length);
  idxs.resize(length);
  - drv.glGetBufferSubData(eGL_ELEMENT_ARRAY_BUFFER, offset,
  + drv.glGetBufferSubData(
  + eGL_ELEMENT_ARRAY_BUFFER, offset,
  RDCMIN(GLsizeiptr(length - offset),
  GLsizeiptr(draw->numIndices) * GLsizeiptr(draw->indexByteWidth)),
  &idxs[0]);
  @@ -388,11 +393,28 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve
  // unbind the real index buffer
  drv.glBindBuffer(eGL_ELEMENT_ARRAY_BUFFER, 0);
  - std::vector<uint32_t> patchedIndices;
  + uint32_t expectedSize = draw->numIndices * draw->indexByteWidth;
  +
  + if(idxs.size() < expectedSize)
  + {
  + RDCERR("Index buffer is as large as expected");
  + idxs.resize(expectedSize);
  + }
  +
  PatchLineStripIndexBuffer(
  draw, draw->indexByteWidth == 1 ? (uint8_t *)idxs.data() : (uint8_t *)NULL,
  draw->indexByteWidth == 2 ? (uint16_t *)idxs.data() : (uint16_t *)NULL,
  draw->indexByteWidth == 4 ? (uint32_t *)idxs.data() : (uint32_t *)NULL, patchedIndices);
  + }
  + else
  + {
  + // generate 'index' list
  + std::vector<uint32_t> idxs;
  + idxs.resize(draw->numIndices);
  + for(uint32_t i = 0; i < draw->numIndices; i++)
  + idxs[i] = i;
  + PatchLineStripIndexBuffer(draw, NULL, NULL, idxs.data(), patchedIndices);
  + }
  GLboolean primRestart = drv.glIsEnabled(eGL_PRIMITIVE_RESTART_FIXED_INDEX);
  drv.glEnable(eGL_PRIMITIVE_RESTART_FIXED_INDEX);
  