ezEngine  Release 25.03
ezUniformBufferPoolVulkan Class Reference

ezGALBufferVulkan created with ezGALBufferUsageFlags::Transient will allocate scratch memory from this pool which will last until the end of the frame. More...

#include <UniformBufferPoolVulkan.h>

Public Types

enum  BufferUpdateResult { BufferUpdateResult::OffsetChanged, BufferUpdateResult::DynamicBufferChanged }
 

Public Member Functions

 ezUniformBufferPoolVulkan (ezGALDeviceVulkan *pDevice)
 
void Initialize ()
 
void DeInitialize ()
 
void EndFrame ()
 
void BeforeCommandBufferSubmit ()
 
BufferUpdateResult UpdateBuffer (const ezGALBufferVulkan *pBuffer, ezArrayPtr< const ezUInt8 > data)
 Needs to be called each from for a buffer before it can be used. Can be called multiple times per frame. GetBuffer will always return a reference to the last UpdateBuffer content. More...
 
const vk::DescriptorBufferInfo * GetBuffer (const ezGALBufferVulkan *pBuffer) const
 

Detailed Description

ezGALBufferVulkan created with ezGALBufferUsageFlags::Transient will allocate scratch memory from this pool which will last until the end of the frame.

Member Enumeration Documentation

◆ BufferUpdateResult

Enumerator
OffsetChanged 

The offset of the current buffer was moved forward.

DynamicBufferChanged 

The current buffer was depleted and a new buffer was started.

Member Function Documentation

◆ GetBuffer()

const vk::DescriptorBufferInfo * ezUniformBufferPoolVulkan::GetBuffer ( const ezGALBufferVulkan pBuffer) const

Access the descriptor info for the given buffer.

Parameters
pBufferThe buffer for which previously scratch memory was allocated for.
Returns
Pointer to the descriptor info.

◆ UpdateBuffer()

ezUniformBufferPoolVulkan::BufferUpdateResult ezUniformBufferPoolVulkan::UpdateBuffer ( const ezGALBufferVulkan pBuffer,
ezArrayPtr< const ezUInt8 >  data 
)

Needs to be called each from for a buffer before it can be used. Can be called multiple times per frame. GetBuffer will always return a reference to the last UpdateBuffer content.

Parameters
pBufferThe buffer to allocate scratch memory for.
dataThe data of the buffer. Must be the size of the entire buffer.
Returns
Returns whether a new pool needed to be created.

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