mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-29 12:28:39 +00:00
0ef6c7555e
Some drivers (at least the Intel drivers on Windows) are slow at incrementally updating a VBO with hundreds of calls to glBufferSubData every frame. Performance is significantly better if you use glBufferData(NULL) to tell it to discard all the previous contents, and then re-upload all the data at once. Update CVertexBuffer so that GL_DYNAMIC_DRAW/GL_STREAM_DRAW buffers are handled with the new mechanism. This requires the caller to hold onto the backing store so it can be re-uploaded when necessary, and needs a bit more signalling to indicate exactly what needs uploading. I see an improvement from roughly 60 to 75 fps on Intel HD Graphics 3000, Windows, 1024x768, Siwa Oasis. This was SVN commit r16241.