I am developing a simple game with vulkan.
Need help / information with how memory can be allocated or deallocated at runtime. So, the case being creating or destroying objects or players at runtime.
The vertex and index buffer can be ‘prepared’ at initialization with the vertex and index data, and as such will not change at all during my game.
The transform data, however would be dynamic, depending on how many objects / players are spawned in the scene. So i have currently used a dynamic uniform buffer with transform data for four objects, known at startup time. How can i extend this to incorporate dynamic transform data.
Is this possible. I would ideally like to avoid allocating a huge block of memory without knowing how much of it would be actually used. Even if I did allocate, e.g. 1GB and during runtime, the game required one transform block more than I what I allocated. How would i do it effectively.
Please let me know if you need more information.
An object spawed into the scene would require its