OpenJK icon indicating copy to clipboard operation
OpenJK copied to clipboard

AZDO: Vertex array objects per vertex format

Open xycaleth opened this issue 9 years ago • 0 comments

To reduce driver overhead, we can reduce the number of calls to glVertexAttribPointer and co. Ahead of time, any model will know what format their vertex data is stored in. We can create a vertex array object per vertex format, each with a large vertex buffer. When allocating GPU mem for vertex data, we sub allocate out of these vertex buffers. At render time, draw calls can be sorted by vertex format and the base vertex can be used to specify which section of the vertex buffer to use:

bind vertex array object
for each object with this format:
  draw object with base vertex

xycaleth avatar May 01 '16 09:05 xycaleth