Monado OpenXR Runtime
render_sub_alloc_tracker Struct Reference

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>

Collaboration diagram for render_sub_alloc_tracker:

Data Fields

VkBuffer buffer
 The buffer to allocate from, it's the callers 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...
 

Detailed Description

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 indivudial sub-allocation, or even track them beyond filling the UBO data and descriptor sets.

See also
render_sub_alloc

Field Documentation

◆ buffer

VkBuffer render_sub_alloc_tracker::buffer

The buffer to allocate from, it's the callers responsibility to keep it alive for as long as the sub-allocations are in used.

Referenced by render_sub_alloc_tracker_init().

◆ mapped

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().

◆ total_size

VkDeviceSize render_sub_alloc_tracker::total_size

◆ used

VkDeviceSize render_sub_alloc_tracker::used

The documentation for this struct was generated from the following file: