LukasBanana / LLGL

Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal
BSD 3-Clause "New" or "Revised" License
2.04k stars 137 forks source link

Internal memory allocation callbacks #25

Open raxvan opened 6 years ago

raxvan commented 6 years ago

Does LLGL have support for host memory allocations callbacks ? Such as VkAllocationCallbacks for vulkan? How about other apis (dx, ogl, etc) and other library allocations ?

If not, is this planned ?

LukasBanana commented 6 years ago

The Vulkan backend is still in an experimental state. Compared to the D3D12 and Metal backends more usable, though. However, right now there is no such interface to control the Vulkan allocation model. I currently also have no plans when and how I implement this. As long as the Vulkan backend does not have significiantly better performance than the D3D11 and GL backends, I don't see the necessity for such fine grained memory control.

ForgeMistress commented 5 years ago

What about memory control of the internal structures that LLGL itself allocates? Is there a way for us to define allocation routines for the library as a whole?

LukasBanana commented 5 years ago

There are currently no interfaces or plans for this fine-grained memory control. LLGL uses the default STL containers and allocators only (with very few exceptions).

ForgeMistress commented 5 years ago

I guess an alternative then is to overload the default new and delete. I've got allocation tracking for leak detection and a few cache coherence tricks I'm using to squeeze some perf out of my framework.