Open 3D Engine Atom Gem API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Member Functions | Static Public Member Functions | Friends | List of all members
AZ::RPI::Buffer Class Referencefinal

Inherits InstanceData.

Public Member Functions

 AZ_INSTANCE_DATA (Buffer, "{389B818E-136A-44A4-8B6C-4766C0DDB644}")
 AZ_CLASS_ALLOCATOR (Buffer, AZ::SystemAllocator, 0)
void WaitForUpload ()
 Blocks until a streaming upload has completed (if one is currently in flight).
RHI::BufferGetRHIBuffer ()
const RHI::BufferGetRHIBuffer () const
const RHI::BufferViewGetBufferView () const
bool UpdateData (const void *sourceData, uint64_t sourceDataSizeInBytes, uint64_t bufferByteOffset=0)
 Update buffer's content with sourceData at an offset of bufferByteOffset.
bool Orphan ()
bool OrphanAndUpdateData (const void *sourceData, uint64_t sourceDataSizeInBytes)
void * Map (size_t byteCount, uint64_t byteOffset)
void Unmap ()
const RHI::AttachmentId & GetAttachmentId () const
 Get attachment id if this buffer is used as scope attachment.
template<class structureType >
void SetAsStructured ()
 Set default buffer view descriptor with specific structure.
const RHI::BufferViewDescriptorGetBufferViewDescriptor () const
 Get view descriptor of this buffer.
uint64_t GetBufferSize () const
 Get buffer size in bytes.
void Resize (uint64_t bufferSize)

Static Public Member Functions

static Data::Instance< BufferFindOrCreate (const Data::Asset< BufferAsset > &bufferAsset)
 Instantiates or returns an existing buffer instance using its paired asset.


class BufferSystem

Member Function Documentation

◆ Orphan()

bool AZ::RPI::Buffer::Orphan ( )

Reallocate a new block of memory for this buffer. The previous allocated memory will be discarded once the GPU is done using it. This only works for buffers with host heap memory level.

◆ OrphanAndUpdateData()

bool AZ::RPI::Buffer::OrphanAndUpdateData ( const void *  sourceData,
uint64_t  sourceDataSizeInBytes 

Orphan the buffer then update the buffer's content with input sourceData This function is only used for buffer created in host such as dynamic buffer which content is rewritten every frame

◆ Resize()

void AZ::RPI::Buffer::Resize ( uint64_t  bufferSize)

Resize the current buffer. The data in the buffer won't be kept The buffer view descriptor and buffer view will be updated accordingly

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