Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | List of all members
castor3d::GpuBaseBufferT< AllocatorT > Class Template Reference

A GPU buffer pool, that uses an allocator to allocate sub-buffers. More...

#include <GpuBuffer.hpp>

Public Member Functions

 GpuBaseBufferT (RenderDevice const &device, VkBufferUsageFlags usage, VkMemoryPropertyFlags memoryFlags, castor::String const &debugName, ashes::QueueShare sharingMode, AllocatorT allocator)
 Constructor.
 
bool hasAvailable (VkDeviceSize size) const noexcept
 
MemChunk allocate (VkDeviceSize size) noexcept
 Allocates a memory chunk for a CPU buffer.
 
void deallocate (MemChunk const &mem) noexcept
 Deallocates memory.
 
size_t getMinAlignment () const noexcept
 
ashes::BufferBase const & getBuffer () const noexcept
 
ashes::BufferBase & getBuffer () noexcept
 

Detailed Description

template<typename AllocatorT>
class castor3d::GpuBaseBufferT< AllocatorT >

A GPU buffer pool, that uses an allocator to allocate sub-buffers.

Constructor & Destructor Documentation

◆ GpuBaseBufferT()

template<typename AllocatorT >
castor3d::GpuBaseBufferT< AllocatorT >::GpuBaseBufferT ( RenderDevice const & device,
VkBufferUsageFlags usage,
VkMemoryPropertyFlags memoryFlags,
castor::String const & debugName,
ashes::QueueShare sharingMode,
AllocatorT allocator )

Constructor.

Parameters
[in]deviceThe device on which the storage is allocated.
[in]usageThe buffer targets.
[in]memoryFlagsThe buffer memory properties.
[in]debugNameThe debug name.
[in]sharingModeThe sharing mode.
[in]allocatorThe allocator.

Member Function Documentation

◆ allocate()

template<typename AllocatorT >
MemChunk castor3d::GpuBaseBufferT< AllocatorT >::allocate ( VkDeviceSize size)
noexcept

Allocates a memory chunk for a CPU buffer.

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

◆ deallocate()

template<typename AllocatorT >
void castor3d::GpuBaseBufferT< AllocatorT >::deallocate ( MemChunk const & mem)
noexcept

Deallocates memory.

Parameters
[in]memThe memory chunk.

◆ getBuffer() [1/2]

template<typename AllocatorT >
ashes::BufferBase const & castor3d::GpuBaseBufferT< AllocatorT >::getBuffer ( ) const
inlinenoexcept
Returns
The internal buffer.

Referenced by castor3d::ObjectBufferOffset::GpuBufferChunk::getBuffer().

Here is the caller graph for this function:

◆ getBuffer() [2/2]

template<typename AllocatorT >
ashes::BufferBase & castor3d::GpuBaseBufferT< AllocatorT >::getBuffer ( )
inlinenoexcept
Returns
The internal buffer.

◆ getMinAlignment()

template<typename AllocatorT >
size_t castor3d::GpuBaseBufferT< AllocatorT >::getMinAlignment ( ) const
noexcept
Returns
The element aligned size.

◆ hasAvailable()

template<typename AllocatorT >
bool castor3d::GpuBaseBufferT< AllocatorT >::hasAvailable ( VkDeviceSize size) const
noexcept
Parameters
[in]sizeThe requested memory size.
Returns
true if there is enough remaining memory for given size.

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