|
CeresEngine 0.2.0
A game development framework
|
#include <CeresEngine/RenderAPI/Vulkan/VKBuffer.hpp>
Public Types | |
| using | Allocator = VKObjectAllocator |
An allocator type used to allocate new VKBuffer instances from a memory pool. | |
Public Types inherited from CeresEngine::TDeviceObject< GPUBufferDescriptor, GPUResource > | |
| using | Descriptor = GPUBufferDescriptor |
| An type-alias to the descriptor struct type. | |
Public Member Functions | |
| VKBuffer (VKDevice &device, VKMemoryAllocator &memoryAllocator, const GPUBufferDescriptor &descriptor) | |
| Creates a new Vulkan buffer object. | |
| ~VKBuffer () final | |
| Destroys the buffer object and releases the GPU memory. | |
| operator VkBuffer () const noexcept | |
| The Vulkan buffer object. | |
| GPUBufferData | map () final |
| void | unmap () final |
| GPUBufferSize | getSize () const final |
| void | flush (GPUBufferSize offset=0, GPUBufferSize size=whole) final |
| void | invalidate (GPUBufferSize offset=0, GPUBufferSize size=whole) final |
Public Member Functions inherited from CeresEngine::GPUBuffer | |
| GPUBuffer (const GPUBuffer &)=delete | |
| Deleted copy constructor. | |
| GPUBuffer & | operator= (const GPUBuffer &)=delete |
| GPUBuffer (GPUBuffer &&)=delete | |
| Deleted move constructor. | |
| GPUBuffer & | operator= (GPUBuffer &&)=delete |
| Async< ByteBuffer > | read (GPUBufferSize offset=0, GPUBufferSize size=whole) |
| Performs an asynchronous read operation on the buffer. | |
| Async< ByteBuffer > | read (GPUCommandBuffer &commandBuffer, GPUBufferSize offset=0, GPUBufferSize size=whole) |
| Performs an asynchronous read operation on the buffer in an specific command buffer. | |
| Async | write (ByteBuffer &&rawData, GPUBufferSize offset=0, GPUBufferSize size=whole) |
| Performs an asynchronous write operation on the buffer. | |
| Async | write (GPUCommandBuffer &commandBuffer, ByteBuffer &&rawData, GPUBufferSize offset=0, GPUBufferSize size=whole) |
| Performs an asynchronous write operation on the buffer in an specific command buffer. | |
| template<typename Block > | |
| void | data (Block &&block) |
Executes block with a pointer that gives direct access to the buffer data. | |
| TDeviceObject (GPUDevice &device, const Descriptor &descriptor) | |
| Inherited constructors. | |
| TDeviceObject (const TDeviceObject &)=delete | |
| Inherited constructors. | |
| TDeviceObject (TDeviceObject &&)=delete | |
| Inherited constructors. | |
Public Member Functions inherited from CeresEngine::TDeviceObject< GPUBufferDescriptor, GPUResource > | |
| TDeviceObject (GPUDevice &device, const Descriptor &descriptor) | |
| Initializes a new RenderAPI device object instance. | |
| TDeviceObject (const TDeviceObject &)=delete | |
| TDeviceObject (TDeviceObject &&)=delete | |
| ~TDeviceObject () override=default | |
| TDeviceObject & | operator= (const TDeviceObject &)=delete |
| TDeviceObject & | operator= (TDeviceObject &&)=delete |
Public Member Functions inherited from CeresEngine::GPUResource | |
| GPUDeviceObject (GPUDevice &device) | |
Public Member Functions inherited from CeresEngine::GPUDeviceObject | |
| GPUDeviceObject (GPUDevice &device) | |
| ~GPUDeviceObject () override | |
Public Member Functions inherited from CeresEngine::GPUObject | |
| GPUObject ()=default | |
| virtual | ~GPUObject ()=default |
| GPUObject (const GPUObject &)=delete | |
| GPUObject & | operator= (const GPUObject &)=delete |
| GPUObject (GPUObject &&)=delete | |
| GPUObject & | operator= (GPUObject &&)=delete |
| void | retain () noexcept |
| Retains the object by increment it's reference count by one. | |
| bool | release () noexcept |
| Releases the object by decrementing it's reference count by one. | |
Public Member Functions inherited from CeresEngine::VKDeviceObjectBase | |
| VKDeviceObjectBase (VKDevice &device) noexcept | |
Creates a new VKDeviceObjectBase from the given device. | |
| ~VKDeviceObjectBase () noexcept | |
Destroys the VKDeviceObjectBase. | |
Static Public Member Functions | |
| static Allocator & | getAllocator () noexcept |
Returns the allocator for VKBuffer. | |
| static void * | operator new (size_t size) noexcept |
Allocates memory for a new instance of VKBuffer. | |
| static void | operator delete (void *p, std::size_t size) noexcept |
Deletes memory for an instance of VKBuffer. | |
Static Public Member Functions inherited from CeresEngine::VKObject< ChildTypeName, ParentType > | |
| static RC< ChildTypeName > | cast (const RC< ParentType > &ptr) |
Casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName. | |
| static ChildTypeName & | cast (ParentType &object) |
Casts a object of type ParentType to a object of type ChildTypeName. | |
| static const ChildTypeName & | cast (const ParentType &object) |
Casts a object of type ParentType to a object of type ChildTypeName. | |
| static ChildTypeName * | cast (ParentType *object) |
Casts a object of type ParentType to a object of type ChildTypeName. | |
| static const ChildTypeName * | cast (const ParentType *object) |
Casts a object of type ParentType to a object of type ChildTypeName. | |
Static Public Member Functions inherited from CeresEngine::VKObjectBase | |
| static void * | operator new (size_t size) noexcept |
| static void | operator delete (void *p, std::size_t sz) noexcept |
Private Attributes | |
| const GPUBufferDescriptor | descriptorVK |
| A structure that describes the buffer and it's properties. | |
| VkBuffer | mBuffer = VK_NULL_HANDLE |
| The Vulkan buffer object. | |
| VKMemoryAllocation | mBufferMemory |
| The allocated memory. | |
| GPUBufferData | mMappedMemory = nullptr |
| The buffer mapped memory address. | |
Additional Inherited Members | |
Public Attributes inherited from CeresEngine::TDeviceObject< GPUBufferDescriptor, GPUResource > | |
| const Descriptor & | descriptor |
| A structure that describes the object and it's properties. | |
Public Attributes inherited from CeresEngine::GPUDeviceObject | |
| GPUDevice & | device |
| The owning device this object was created from. | |
Public Attributes inherited from CeresEngine::VKDeviceObjectBase | |
| VKDevice & | deviceVK |
The owning VKDevice instance. | |
Static Public Attributes inherited from CeresEngine::GPUBuffer | |
| static const constexpr GPUBufferSize | whole = ~0UL |
| A constant the represents the whole buffer length. | |
Protected Member Functions inherited from CeresEngine::GPUObject | |
| virtual void | destroy () noexcept |
| A internal method called by the system when the object reference count reaches zero. | |
Protected Member Functions inherited from CeresEngine::VKDeviceObject< VKBuffer, GPUBuffer > | |
| VKDeviceObject (VKDevice &device) noexcept | |
Creates a new VKDeviceObject from the given device. | |
An allocator type used to allocate new VKBuffer instances from a memory pool.
| CeresEngine::VKBuffer::VKBuffer | ( | VKDevice & | device, |
| VKMemoryAllocator & | memoryAllocator, | ||
| const GPUBufferDescriptor & | descriptor | ||
| ) |
Creates a new Vulkan buffer object.
| device | The device to allocate a new buffer from. |
| memoryAllocator | The memory allocator |
| descriptor | The buffer descriptor |
|
final |
Destroys the buffer object and releases the GPU memory.
|
finalvirtual |
Implements CeresEngine::GPUBuffer.
Returns the allocator for VKBuffer.
|
finalvirtual |
Implements CeresEngine::GPUBuffer.
|
finalvirtual |
Implements CeresEngine::GPUBuffer.
|
finalvirtual |
Implements CeresEngine::GPUBuffer.
Deletes memory for an instance of VKBuffer.
Allocates memory for a new instance of VKBuffer.
|
inlinenoexcept |
The Vulkan buffer object.
|
finalvirtual |
Implements CeresEngine::GPUBuffer.
|
private |
A structure that describes the buffer and it's properties.
|
private |
The Vulkan buffer object.
|
private |
The allocated memory.
|
private |
The buffer mapped memory address.