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

#include <GpuBufferLinearAllocator.hpp>

Public Member Functions

C3D_API GpuBufferLinearAllocator (size_t count, uint32_t alignment)
 Constructor. More...
 
C3D_API VkDeviceSize allocate (size_t size)
 Allocates memory. More...
 
C3D_API void deallocate (VkDeviceSize pointer)
 Deallocates memory. More...
 
size_t getTotalSize () const
 
size_t getAlignSize () const
 
bool hasAvailable (size_t) const
 

Constructor & Destructor Documentation

◆ GpuBufferLinearAllocator()

C3D_API castor3d::GpuBufferLinearAllocator::GpuBufferLinearAllocator ( size_t  count,
uint32_t  alignment 
)

Constructor.

Parameters
[in]countThe allocator elements count.
[in]alignmentThe alignment for one element.

Member Function Documentation

◆ allocate()

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

Allocates memory.

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

◆ deallocate()

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

Deallocates memory.

Parameters
[in]pointerThe memory chunk.

◆ getAlignSize()

size_t castor3d::GpuBufferLinearAllocator::getAlignSize ( ) const
inline
Returns
The element aligned size.

◆ getTotalSize()

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

◆ hasAvailable()

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

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