I'm wondering if whether it's a good idea or not to keep a copy of vertex data in the main memory or just read it back via glGetBufferSubData
(or glMapBuffer
/glMapBufferRange
).
The reason why I'd do this is so that I can keep only what's needed in the VRAM (and resource which may be needed very soon in the main memory) but not have to go back and load the resource from the disk again.
The concern that I have is that, with the draw optimized flags (GL_XXXX_DRAW
) is that they aren't optimized for reading back (since there's a seperate flag for that). So if it's not very fast, it kinda defeats the whole purpose.
The other option is storing a second copy and just delete the VBO when I'm done (no reading it back), but I dislike this because it requires more memory usage than might be necessary.
Which option is preferred? Is there another way? Maybe something I'm missing?