ezEngine  Release 25.03
ezStagingBufferPoolVulkan Class Reference

Allocates temporary staging buffers from a large pool. Allocations will automatically be freed at the end of the frame. New (larger) pools will be created if the existing ones run out of space. Pools will be deleted after a certain time of no usage. More...

#include <StagingBufferPoolVulkan.h>

Public Member Functions

void Initialize (ezGALDeviceVulkan *pDevice, ezUInt64 uiStartingPoolSize)
 Initializes the pool. More...
 
void DeInitialize ()
 Needs to be called before destroying this instance. Ensure that the GPU is idle before calling.
 
void AfterBeginFrame ()
 Needs to be called after begin frame to free memory.
 
void BeforeCommandBufferSubmit ()
 Needs to be called before submitting work to the GPU to flush GPU caches.
 
ezStagingBufferVulkan AllocateBuffer (ezUInt64 size)
 Allocates a temp buffer of the given size. More...
 

Detailed Description

Allocates temporary staging buffers from a large pool. Allocations will automatically be freed at the end of the frame. New (larger) pools will be created if the existing ones run out of space. Pools will be deleted after a certain time of no usage.

Member Function Documentation

◆ AllocateBuffer()

ezStagingBufferVulkan ezStagingBufferPoolVulkan::AllocateBuffer ( ezUInt64  size)

Allocates a temp buffer of the given size.

Parameters
sizeThe size of the temp buffer.
Returns
Allocated temp buffer.

◆ Initialize()

void ezStagingBufferPoolVulkan::Initialize ( ezGALDeviceVulkan pDevice,
ezUInt64  uiStartingPoolSize 
)

Initializes the pool.

Parameters
pDeviceGAL device.
uiStartingPoolSizeSize of the first pool. If depleted, a new one with twice the size of the previous one is created.

The documentation for this class was generated from the following files: