mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-11 04:31:35 -10:00
This changes the model loading code such that all index and vertex data is packed in a single GPU buffer for each data type (index and vertex data are still in separate buffers). This reduces the amount of buffer rebinding needed when rendering a scene which will reduce the CPU overhead. Furthermore, this opens up possibilities of future improvements for which it is beneficial if all data is in the same buffer (e.g. MultiDrawIndirect rendering). To manage where to put the data in the GPU buffer I implemented a custom HeapAllocator which manages where data can be put. It uses a very primitive first-fit algorithm but that is sufficient for this usage type. This does add quite a lot of overhead while allocating GPU model data (I did some tracing and some allocation calls took as long as 130ms). This fixes #1457.