Rasterfarm-SDK
Loading...
Searching...
No Matches
MemoryAllocator Class Reference

#include <memorypool.h>

Inheritance diagram for MemoryAllocator:
MemoryPool

Public Member Functions

 MemoryAllocator (VkDevice logicalDevice, uint heapIndex, uint pageSize=sysconf(_SC_PAGESIZE))
 
 MemoryAllocator (const MemoryAllocator &other)=delete
 
AllocationHandle allocate (const VkMemoryRequirements &memoryRequirements, MemoryType type)
 
AllocationHandle allocateBuffer (VkBuffer buffer, MemoryType type)
 
AllocationHandle allocateImage (VkImage image, MemoryType type)
 
void bindBuffer (VkBuffer buffer, AllocationHandle handle)
 
void bindImage (VkImage image, AllocationHandle handle)
 
void * getMemory (AllocationHandle handle)
 
void * map (AllocationHandle handle)
 
- Public Member Functions inherited from MemoryPool
 MemoryPool (VkDevice logicalDevice, uint heapIndex, uint pageSize=sysconf(_SC_PAGESIZE))
 
 ~MemoryPool ()
 
 MemoryPool (const MemoryPool &other)=delete
 
VkDevice getDevice ()
 
uint pageLength (uint offset, uint size)
 
uint getMemoryOffset (const Allocation &allocation)
 
uint size (const Allocation &allocation)
 
uint size (const Allocation &allocation, uint alignment)
 
uint size (uint memoryOffset, uint dataSize, uint alignment)
 
bool isAligned (const Allocation &allocation, uint alignment)
 
void align (AllocationHandle handle, uint alignment)
 
const AllocationgetAllocation (AllocationHandle handle)
 
AllocationHandle allocate (VkDeviceSize size, uint alignment, MemoryType type)
 
void free (AllocationHandle handle)
 
void flush (AllocationHandle handle)
 

Additional Inherited Members

- Public Attributes inherited from MemoryPool
const uint heapIndex
 
const uint heapSize
 
const uint pageSize
 
const uint blockSize
 
const uint blockTableLimit
 
- Protected Attributes inherited from MemoryPool
UnorderedMap< VkDeviceMemory, void * > hostMapped
 

Constructor & Destructor Documentation

◆ MemoryAllocator() [1/2]

MemoryAllocator::MemoryAllocator ( VkDevice logicalDevice,
uint heapIndex,
uint pageSize = sysconf(_SC_PAGESIZE) )
Parameters
Thelogical-device with memory-heap(s).
Thetype of memory this pool holds.
Theindex of the memory-heap the pool memory was allocated-from.

◆ MemoryAllocator() [2/2]

MemoryAllocator::MemoryAllocator ( const MemoryAllocator & other)
delete

A MemoryAllocator must not be copied.

Member Function Documentation

◆ allocate()

AllocationHandle MemoryAllocator::allocate ( const VkMemoryRequirements & memoryRequirements,
MemoryType type )

◆ allocateBuffer()

AllocationHandle MemoryAllocator::allocateBuffer ( VkBuffer buffer,
MemoryType type )

◆ allocateImage()

AllocationHandle MemoryAllocator::allocateImage ( VkImage image,
MemoryType type )

◆ bindBuffer()

void MemoryAllocator::bindBuffer ( VkBuffer buffer,
AllocationHandle handle )

◆ bindImage()

void MemoryAllocator::bindImage ( VkImage image,
AllocationHandle handle )

◆ getMemory()

void * MemoryAllocator::getMemory ( AllocationHandle handle)

◆ map()

void * MemoryAllocator::map ( AllocationHandle handle)

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