Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | List of all members
castor3d::GpuBufferPackedAllocator Struct Reference

#include <GpuBufferPackedAllocator.hpp>

Public Member Functions

C3D_API GpuBufferPackedAllocator (size_t size, size_t alignSize=1u)
 Constructor.
 
C3D_API VkDeviceSize allocate (size_t size)
 Allocates memory.
 
C3D_API void deallocate (VkDeviceSize pointer)
 Deallocates memory.
 
size_t getTotalSize () const
 
size_t getAlignSize () const
 
bool hasAvailable (size_t size) const
 

Constructor & Destructor Documentation

◆ GpuBufferPackedAllocator()

C3D_API castor3d::GpuBufferPackedAllocator::GpuBufferPackedAllocator ( size_t size,
size_t alignSize = 1u )
explicit

Constructor.

Parameters
[in]sizeThe allocated size.
[in]alignSizeThe alignment used for buffer chunks.

Member Function Documentation

◆ allocate()

C3D_API VkDeviceSize castor3d::GpuBufferPackedAllocator::allocate ( size_t size)

Allocates memory.

Parameters
[in]sizeThe requested memory size.
Returns
The memory chunk.

◆ deallocate()

C3D_API void castor3d::GpuBufferPackedAllocator::deallocate ( VkDeviceSize pointer)

Deallocates memory.

Parameters
[in]pointerThe memory chunk.

◆ getAlignSize()

size_t castor3d::GpuBufferPackedAllocator::getAlignSize ( ) const
inline
Returns
The alignment used for buffer chunks.

◆ getTotalSize()

size_t castor3d::GpuBufferPackedAllocator::getTotalSize ( ) const
inline
Returns
The allocator size.

◆ hasAvailable()

bool castor3d::GpuBufferPackedAllocator::hasAvailable ( size_t size) const
inline
Returns
true if there is enough remaining memory for given size.

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