Open 3D Engine Meshlets Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::Meshlets::SharedBuffer Class Reference

===================================================================== More...

#include <SharedBuffer.h>

Inherits AZ::Meshlets::SharedBufferInterface, and SystemTickBus::Handler.

Public Member Functions

 AZ_RTTI (AZ::Meshlets::SharedBuffer, "{6005990E-3BBF-4946-9F2B-6A7739912100}", AZ::Meshlets::SharedBufferInterface)
 
 SharedBuffer (AZStd::string bufferName, uint32_t sharedBufferSize, AZStd::vector< SrgBufferDescriptor > &buffersDescriptors)
 
void Init (AZStd::string bufferName, AZStd::vector< SrgBufferDescriptor > &buffersDescriptors)
 
AZStd::intrusive_ptr< SharedBufferAllocationAllocate (size_t byteCount) override
 
void DeAllocate (RHI::VirtualAddress allocation) override
 
void DeAllocateNoSignal (RHI::VirtualAddress allocation) override
 
Data::Instance< RPI::Buffer > GetBuffer () override
 Returns the buffer that is used for all skinned mesh outputs.
 
bool UpdateData (const void *sourceData, uint64_t sourceDataSizeInBytes, uint64_t bufferByteOffset=0) override
 Update the content of an area within the shared buffer.
 
- Public Member Functions inherited from AZ::Meshlets::SharedBufferInterface
 AZ_RTTI (AZ::Meshlets::SharedBufferInterface, "{6048DAF9-7A05-41B3-94C8-FBBDB3A187D2}")
 
virtual Data::Instance< RPI::Buffer > GetBuffer ()=0
 Returns the buffer that is used for all skinned mesh outputs.
 
virtual AZStd::intrusive_ptr< SharedBufferAllocationAllocate (size_t byteCount)=0
 
virtual void DeAllocate (RHI::VirtualAddress allocation)=0
 
virtual void DeAllocateNoSignal (RHI::VirtualAddress allocation)=0
 
virtual bool UpdateData (const void *sourceData, uint64_t sourceDataSizeInBytes, uint64_t bufferByteOffset=0)=0
 Update buffer's content with sourceData at an offset of bufferByteOffset.
 
 AZ_DISABLE_COPY_MOVE (SharedBufferInterface)
 

Additional Inherited Members

- Static Public Member Functions inherited from AZ::Meshlets::SharedBufferInterface
static SharedBufferInterfaceGet ()
 

Detailed Description

=====================================================================

===================================================================== This class represents a single RPI::Buffer used to allocate sub-buffers from the existing buffer that can then be used per draw. In a way, this buffer is used as a memory pool from which sub-buffers are being created. This is very useful when we want to synchronize the use of these buffers via barriers so we declare and pass the entire buffer between passes and therefore we are creating a dependency and barrier for this single buffer, yet as a result all sub-buffers are now getting synced between passes.

Member Function Documentation

◆ Allocate()

AZStd::intrusive_ptr< SharedBufferAllocation > AZ::Meshlets::SharedBuffer::Allocate ( size_t  byteCount)
overridevirtual

If the allocation succeeds, returns a ref-counted pointer to a VirtualAddress which will be automatically freed if the ref-count drops to zero If the allocation fails, returns nullptr

Implements AZ::Meshlets::SharedBufferInterface.

◆ DeAllocate()

void AZ::Meshlets::SharedBuffer::DeAllocate ( RHI::VirtualAddress  allocation)
overridevirtual

Mark the memory as available and queue garbage collection to recycle it later (see RHI::Allocator::DeAllocate) After garbage collection is done signal handlers that memory has been freed

Implements AZ::Meshlets::SharedBufferInterface.

◆ DeAllocateNoSignal()

void AZ::Meshlets::SharedBuffer::DeAllocateNoSignal ( RHI::VirtualAddress  allocation)
overridevirtual

Same as DeAllocate, but the signal after garbage collection is ignored If multiple allocations succeeded before one failed, use this to release the successful allocations without triggering new events indicating that new memory has been freed

Implements AZ::Meshlets::SharedBufferInterface.

◆ GetBuffer()

Data::Instance< RPI::Buffer > AZ::Meshlets::SharedBuffer::GetBuffer ( )
overridevirtual

Returns the buffer that is used for all skinned mesh outputs.

Implements AZ::Meshlets::SharedBufferInterface.

◆ UpdateData()

bool AZ::Meshlets::SharedBuffer::UpdateData ( const void *  sourceData,
uint64_t  sourceDataSizeInBytes,
uint64_t  bufferByteOffset = 0 
)
overridevirtual

Update the content of an area within the shared buffer.

Implements AZ::Meshlets::SharedBufferInterface.


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