#include <BufferMemory.h>
Inherits AZ::RHI::DeviceObject.
Classes | |
struct | Descriptor |
Public Member Functions | |
AZ_CLASS_ALLOCATOR (BufferMemory, AZ::ThreadPoolAllocator) | |
AZ_RTTI (BufferMemory, "{39053FBD-CE0E-44E8-A9BF-29C4014C3958}", Base) | |
RHI::ResultCode | Init (Device &device, const MemoryView &memoryView, const Descriptor &descriptor) |
RHI::ResultCode | Init (Device &device, const Descriptor &descriptor) |
CpuVirtualAddress | Map (size_t offset, size_t size, RHI::HostMemoryAccess hostAccess) |
void | Unmap (size_t offset, RHI::HostMemoryAccess hostAccess) |
const VkBuffer | GetNativeBuffer () |
const Descriptor & | GetDescriptor () const |
size_t | GetSize () const |
![]() | |
AZ_RTTI (DeviceObject, "{17D34F71-944C-4AF5-9823-627474C4C0A6}", Object) | |
bool | IsInitialized () const |
Returns whether the device object is initialized. | |
Device & | GetDevice () const |
![]() | |
AZ_RTTI (Object, "{E43378F1-2331-4173-94B8-990ED20E6003}") | |
void | SetName (const Name &name) |
Sets the name of the object. | |
const Name & | GetName () const |
Returns the name set on the object by SetName. | |
uint32_t | use_count () |
Returns the current use count of the object. | |
Static Public Member Functions | |
static RHI::Ptr< BufferMemory > | Create () |
Additional Inherited Members | |
![]() | |
void | Init (Device &device) |
The derived class should call this method to assign the device. | |
void | Shutdown () override |
Clears the current bound device to null. | |
![]() | |
void | add_ref () const |
void | release () const |
![]() | |
AZStd::atomic_int | m_useCount = 0 |
A BufferMemory represents a Vulkan's Buffer that will be sub allocated into one or multiple RHI Buffer Resources. Each of the RHI Buffers reference a section of the Vulkan Buffer. The Vulkan Buffer sits on top of a Vulkan Memory Region. When it is removed, the native buffer will be freed.
| VmaAllocation | |_______________________________________________________________|
| VkBuffer (BufferMemoryView) || VkBuffer (BufferMemoryView) | |_______________________________||______________________________|
| RHI Buffer || RHI Buffer || RHI Buffer | |_______________||______________||______________________________|