CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::VKMemoryAllocator Class Referencefinal

#include <CeresEngine/RenderAPI/Vulkan/VKMemoryAllocator.hpp>

Inheritance diagram for CeresEngine::VKMemoryAllocator:
CeresEngine::VKDeviceObject< VKMemoryAllocator > CeresEngine::VKObject< ChildTypeName, ParentType > CeresEngine::VKDeviceObjectBase CeresEngine::VKObjectBase

Public Member Functions

 VKMemoryAllocator (VKDevice &device, VkDeviceSize preferredLargeHeapBlockSize)
 
 ~VKMemoryAllocator ()
 
VKMemoryAllocation allocate (const VkMemoryRequirements &memoryRequirements, VkMemoryPropertyFlags requiredFlags, VkMemoryPropertyFlags preferredFlags=0)
 Allocates memory from the allocator.
 
VKMemoryAllocation allocate (VkBuffer buffer, VkMemoryPropertyFlags requiredFlags, VkMemoryPropertyFlags preferredFlags=0)
 Allocates and binds memory for the given buffer.
 
VKMemoryAllocation allocate (VkImage image, VkMemoryPropertyFlags requiredFlags, VkMemoryPropertyFlags preferredFlags=0)
 Allocates and binds memory for the given ``.
 
- Public Member Functions inherited from CeresEngine::VKDeviceObjectBase
 VKDeviceObjectBase (VKDevice &device) noexcept
 Creates a new VKDeviceObjectBase from the given device.
 
 ~VKDeviceObjectBase () noexcept
 Destroys the VKDeviceObjectBase.
 

Private Attributes

VmaAllocator allocator = nullptr
 The Vulkan memory allocator instance.
 

Friends

class VKMemoryAllocation
 

Additional Inherited Members

- Static Public Member Functions inherited from CeresEngine::VKObject< ChildTypeName, ParentType >
static RC< ChildTypeNamecast (const RC< ParentType > &ptr)
 Casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName.
 
static ChildTypeNamecast (ParentType &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamecast (const ParentType &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static ChildTypeNamecast (ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamecast (const ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
- Static Public Member Functions inherited from CeresEngine::VKObjectBase
static voidoperator new (size_t size) noexcept
 
static void operator delete (void *p, std::size_t sz) noexcept
 
- Public Attributes inherited from CeresEngine::VKDeviceObjectBase
VKDevicedeviceVK
 The owning VKDevice instance.
 
- Protected Member Functions inherited from CeresEngine::VKDeviceObject< VKMemoryAllocator >
 VKDeviceObject (VKDevice &device) noexcept
 Creates a new VKDeviceObject from the given device.
 

Constructor & Destructor Documentation

◆ VKMemoryAllocator()

CeresEngine::VKMemoryAllocator::VKMemoryAllocator ( VKDevice device,
VkDeviceSize  preferredLargeHeapBlockSize 
)
explicit

◆ ~VKMemoryAllocator()

CeresEngine::VKMemoryAllocator::~VKMemoryAllocator ( )

Member Function Documentation

◆ allocate() [1/3]

VKMemoryAllocation CeresEngine::VKMemoryAllocator::allocate ( const VkMemoryRequirements memoryRequirements,
VkMemoryPropertyFlags  requiredFlags,
VkMemoryPropertyFlags  preferredFlags = 0 
)

Allocates memory from the allocator.

Parameters
memoryRequirementsThe Vulkan memory requirements structure
requiredFlagsThe required memory flags
preferredFlagsThe preferred memory flags
Returns
The allocated memory handle

◆ allocate() [2/3]

VKMemoryAllocation CeresEngine::VKMemoryAllocator::allocate ( VkBuffer  buffer,
VkMemoryPropertyFlags  requiredFlags,
VkMemoryPropertyFlags  preferredFlags = 0 
)

Allocates and binds memory for the given buffer.

Parameters
bufferThe buffer to allocate memory for
requiredFlagsThe required memory flags to the allocated memory
preferredFlagsThe preferred memory flags to the allocated memory
Returns
The allocated memory handle

◆ allocate() [3/3]

VKMemoryAllocation CeresEngine::VKMemoryAllocator::allocate ( VkImage  image,
VkMemoryPropertyFlags  requiredFlags,
VkMemoryPropertyFlags  preferredFlags = 0 
)

Allocates and binds memory for the given ``.

Parameters
imageThe to allocate memory for
requiredFlagsThe required memory flags to the allocated memory
preferredFlagsThe preferred memory flags to the allocated memory
Returns
The allocated memory handle

Friends And Related Symbol Documentation

◆ VKMemoryAllocation

Member Data Documentation

◆ allocator

VmaAllocator CeresEngine::VKMemoryAllocator::allocator = nullptr
private

The Vulkan memory allocator instance.


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