ezEngine Release 26.9
Loading...
Searching...
No Matches
ezConstantBufferStorageBase Class Reference

#include <ConstantBufferStorage.h>

Inheritance diagram for ezConstantBufferStorageBase:

Public Member Functions

ezArrayPtr< ezUInt8 > GetRawDataForWriting ()
 
ezArrayPtr< const ezUInt8 > GetRawDataForReading () const
 Returns read-only access to the buffer data.
 
void BeforeBeginFrame ()
 Called at the beginning of each frame to reset per-frame state.
 
void UploadData (ezGALCommandEncoder *pCommandEncoder)
 
EZ_ALWAYS_INLINE ezGALBufferHandle GetGALBufferHandle () const
 

Protected Member Functions

 ezConstantBufferStorageBase (ezUInt32 uiSizeInBytes)
 

Protected Attributes

bool m_bHasBeenModified = false
 
bool m_bStartOfFrame = true
 
ezUInt32 m_uiLastHash = 0
 
ezGALBufferHandle m_hGALConstantBuffer
 
ezArrayPtr< ezUInt8 > m_Data
 

Friends

class ezRenderContext
 
class ezMemoryUtils
 

Detailed Description

Wrapper around ezGALBufferHandle that automates buffer updates.

Created via ezRenderContext::CreateConstantBufferStorage. Retrieved via ezRenderContext::TryGetConstantBufferStorage, updated lazily via ezRenderContext::UploadConstants. Uses hashing to avoid redundant uploads when data hasn't changed.

Member Function Documentation

◆ GetRawDataForWriting()

ezArrayPtr< ezUInt8 > ezConstantBufferStorageBase::GetRawDataForWriting ( )

Returns writable access to the buffer data.

Marks the buffer as modified for the next upload.

◆ UploadData()

void ezConstantBufferStorageBase::UploadData ( ezGALCommandEncoder *  pCommandEncoder)

Uploads modified data to the GPU.

Uses hashing to skip upload if data hasn't changed since last upload.


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