Is it ok to glBufferSubData for an index buffer


I’m wondering if it’s good to use glBufferSubData for an index buffer.
Looking online glBufferSubData seems to be mostly associated with a vertex buffer.
The one thread I could find about a glBufferSubData and an index buffer was one user reporting this operating extremely slow.

I want to use glBufferSubData for my index buffer to implement an Lod system. But I’m not sure if this is recommended or if this method is even often done. I don’t want to run into compatibility issues or driver problems by doing this.
Is it safe and not slow like using glBufferSubData for a vertex buffer? Does anyone have any experience with this?

There is no such thing as a “vertex buffer” or an “index buffer”. There are just buffer objects. “Vertex buffer” and “index buffer” are ways you can use a buffer object (ways the GPU can read from or write to them), but they don’t change the nature of the buffer object itself.

That is, all buffer objects are the same: a linear array of memory that GPU processes can read from or write to. All buffer object operations are equally valid to all buffer objects.

1 Like