Skip to main content
2 of 2
added 135 characters in body
Lenny White
  • 516
  • 2
  • 15

Passing non-interleaved data to glBufferStorage without using glBufferSubData

I would like to use glBufferStorage to load data once into the vertex buffer. However sometimes I want to pass non-interleaved data from separate arrays like shown below.

glBufferStorage(GL_ARRAY_BUFFER, sizeVerts+sizeUVs, 0, 0);
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeVerts, verts.data());
glBufferSubData(GL_ARRAY_BUFFER, sizeVerts, sizeUVs, uvs.data());

Because of this I have to specify GL_DYNAMIC_STORAGE_BIT flag, despite loading the data once, and thus use a less performant alternative.

Are there any workarounds to this problem?

Or does using GL_DYNAMIC_STORAGE_BIT not lead to a significant performance hit, and should I just use it despite loading data once?

Lenny White
  • 516
  • 2
  • 15