I get the impression that it’s not very memory efficient to use vertex buffers compared to regular vertex arrays. Every time I insert data it seems to allocate at least 8 kB of memory no matter what the size of my input arrays. Has anyone else experienced this?
I have a GF4 Ti 4600 and 65 drivers but it seemed to be the same on Quadro4 and Quadro NVS cards as well.
The memory for the VBs is probably aligned, and also duplicated twice, much like texture objects.
Not that if your data are static, you may delete your app’s local memory vertex data once the VBO has been created and feeded.
Unless you want to do per-triangle collision detection, of course.
Per-triangle collision detection usually needs only 12 bytes per vertex, whereas a modern graphics vertex can get as fat as 64 bytes…
I would be interested to hear more about
“Per-triangle collision detection usually needs only 12 bytes per vertex”, can you provide more details?
I have sumbmitted the data as static and freeing the memory allocated by me will hardly make any difference.
Maybe I will make a more in depth look but these are the figures the taskmanager reports when running with vertex buffers and without:
~59 MB with vertex buffers
~35 MB without vertex buffers
I think around 27 MB of the 35 and 59 respectively is allocated for other things but the 59 also includes the actual submitted arrays. So to me that seems like huge waste of memory. Every time I submit an array, size around 1k, the taskmanager reports an 8k increase.
The task manager numbers are bogus, as they include virtual memory that’s somewhat allocated, but not committed. You really only care about your working set size of pages (your “RSS”). Don’t worry about the task manager – worry about specific performance on a specific machine. Say, a 128 MB machine with 32 MB shared framebuffer, running Intel Extreme Graphics on a PC133 memory bus – now, that’s a worst case to get scared of!