Do these two flags have any overhead?
I use immutable buffer storage. Most of my meshes are static, so I just upload the data at creation time by passing a pointer to glBufferStorage(). However, this presents me with a problem now that I've switched to putting all of a given type of vertex attributes in a single buffer (so all vertex positions for all meshes in one buffer, another one for normals, and so on), because I'm using a single multi-draw call per shader switch to draw a render pass.
The problem is now I either have to copy all my mesh data from mesh class instances to these buffers, instead of loading directly from the underlying std::vectors, or use a custom allocator for the vectors that my mesh class uses, where the allocator contiguously stores the elements of multiple vector instances into the underlying bigger buffer. Unfortunately, Visual C++ in debug mode uses a vector container's allocator not just for the element data store, but also rebinds it and allocates some _Container_proxy debugging data structure, and I haven't figured out how to handle that.
I'm wondering if, instead of having static buffer objects, I glBufferStorage() with null data source pointer but set either GL_DYNAMIC_STORAGE_BIT and load each mesh's data with glBufferSubData(), or GL_MAP_WRITE_BIT and write the data to the mapped buffers. But in this case, is there any potential overhead impacting performance after the buffers are filled with data by making the buffers writeable with either of these flags?
Edited by Prune, 03 June 2014 - 06:15 PM.