Monado OpenXR Runtime
|
A per-frame tracker of sub-allocation out of a buffer, used to reduce the number of UBO objects we need to create. More...
#include <render/render_interface.h>
Data Fields | |
VkBuffer | buffer |
The buffer to allocate from, it is the caller's responsibility to keep it alive for as long as the sub-allocations are in used. More... | |
void * | mapped |
Start of memory, if buffer was mapped with initialised. More... | |
VkDeviceSize | total_size |
Total size of buffer. More... | |
VkDeviceSize | used |
Currently used memory. More... | |
A per-frame tracker of sub-allocation out of a buffer, used to reduce the number of UBO objects we need to create.
This code is designed with one constraint in mind, that the lifetime of a sub-allocation is only for one frame and is discarded at the end of it, but also alive for the entire frame. This removes the need to free individual sub-allocation, or even track them beyond filling the UBO data and descriptor sets.
VkBuffer render_sub_alloc_tracker::buffer |
The buffer to allocate from, it is the caller's responsibility to keep it alive for as long as the sub-allocations are in used.
Referenced by render_sub_alloc_tracker_init().
void* render_sub_alloc_tracker::mapped |
Start of memory, if buffer was mapped with initialised.
Referenced by render_sub_alloc_tracker_init(), and render_sub_alloc_ubo_alloc_and_write().
VkDeviceSize render_sub_alloc_tracker::total_size |
Total size of buffer.
Referenced by render_sub_alloc_tracker_init(), and render_sub_alloc_ubo_alloc_and_get_ptr().
VkDeviceSize render_sub_alloc_tracker::used |
Currently used memory.
Referenced by render_sub_alloc_tracker_init(), and render_sub_alloc_ubo_alloc_and_get_ptr().