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

#include <memorypool.h>

Inheritance diagram for MemoryPool:
MemoryAllocator

Public Member Functions

 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)
 

Public Attributes

const uint heapIndex
 
const uint heapSize
 
const uint pageSize
 
const uint blockSize
 
const uint blockTableLimit
 

Protected Attributes

UnorderedMap< VkDeviceMemory, void * > hostMapped
 

Constructor & Destructor Documentation

◆ MemoryPool() [1/2]

MemoryPool::MemoryPool ( VkDevice logicalDevice,
uint heapIndex,
uint pageSize = sysconf(_SC_PAGESIZE) )

When passed a heapIndex, this pool will manage all the heap's memory exclusively.

Parameters
Thelogical-device with memory-heap(s).
Theindex of the memory-heap..
Thesize of an allocation-page.

◆ ~MemoryPool()

MemoryPool::~MemoryPool ( )

◆ MemoryPool() [2/2]

MemoryPool::MemoryPool ( const MemoryPool & other)
delete

A MemoryPool must not be copied.

Member Function Documentation

◆ align()

void MemoryPool::align ( AllocationHandle handle,
uint alignment )

◆ allocate()

AllocationHandle MemoryPool::allocate ( VkDeviceSize size,
uint alignment,
MemoryType type )

◆ flush()

void MemoryPool::flush ( AllocationHandle handle)

◆ free()

void MemoryPool::free ( AllocationHandle handle)

◆ getAllocation()

const Allocation & MemoryPool::getAllocation ( AllocationHandle handle)

◆ getDevice()

VkDevice MemoryPool::getDevice ( )
inline

◆ getMemoryOffset()

uint MemoryPool::getMemoryOffset ( const Allocation & allocation)

◆ isAligned()

bool MemoryPool::isAligned ( const Allocation & allocation,
uint alignment )

◆ pageLength()

uint MemoryPool::pageLength ( uint offset,
uint size )

◆ size() [1/3]

uint MemoryPool::size ( const Allocation & allocation)

◆ size() [2/3]

uint MemoryPool::size ( const Allocation & allocation,
uint alignment )

◆ size() [3/3]

uint MemoryPool::size ( uint memoryOffset,
uint dataSize,
uint alignment )

Member Data Documentation

◆ blockSize

const uint MemoryPool::blockSize

◆ blockTableLimit

const uint MemoryPool::blockTableLimit

◆ heapIndex

const uint MemoryPool::heapIndex

◆ heapSize

const uint MemoryPool::heapSize

◆ hostMapped

UnorderedMap< VkDeviceMemory, void * > MemoryPool::hostMapped
protected

◆ pageSize

const uint MemoryPool::pageSize

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