Castor3D 0.12.0
Multiplatform 3D engine
Public Types | Public Member Functions | List of all members
castor3d::GpuBufferPool Class Reference

#include <GpuBufferPool.hpp>

Inheritance diagram for castor3d::GpuBufferPool:
Inheritance graph
[legend]
Collaboration diagram for castor3d::GpuBufferPool:
Collaboration graph
[legend]

Public Types

using BufferArray = std::vector< std::unique_ptr< GpuBuddyBuffer > >
 

Public Member Functions

C3D_API GpuBufferPool (RenderDevice const &device, castor::String debugName)
 Constructor. More...
 
C3D_API void cleanup ()
 Cleans up all GPU buffers. More...
 
C3D_API void upload (ashes::CommandBuffer const &cb)
 Uploads all ready memory ranges to VRAM. More...
 
template<typename DataT >
GpuBufferOffsetT< DataT > getBuffer (VkBufferUsageFlags target, VkDeviceSize count, VkMemoryPropertyFlags flags)
 Retrieves a GPU buffer with the given size. More...
 
template<typename DataT >
void putBuffer (GpuBufferOffsetT< DataT > const &bufferOffset)
 Releases a GPU buffer. More...
 

Member Typedef Documentation

◆ BufferArray

using castor3d::GpuBufferPool::BufferArray = std::vector< std::unique_ptr< GpuBuddyBuffer > >

Constructor & Destructor Documentation

◆ GpuBufferPool()

C3D_API castor3d::GpuBufferPool::GpuBufferPool ( RenderDevice const &  device,
castor::String  debugName 
)

Constructor.

Parameters
[in]deviceThe GPU device.
[in]debugNameThe debug name.

Member Function Documentation

◆ cleanup()

C3D_API void castor3d::GpuBufferPool::cleanup ( )

Cleans up all GPU buffers.

◆ getBuffer()

template<typename DataT >
GpuBufferOffsetT< DataT > castor3d::GpuBufferPool::getBuffer ( VkBufferUsageFlags  target,
VkDeviceSize  count,
VkMemoryPropertyFlags  flags 
)

Retrieves a GPU buffer with the given size.

Parameters
[in]targetThe buffer type.
[in]countThe wanted buffer element count.
[in]flagsThe buffer memory flags.
Returns
The GPU buffer.

◆ putBuffer()

template<typename DataT >
void castor3d::GpuBufferPool::putBuffer ( GpuBufferOffsetT< DataT > const &  bufferOffset)

Releases a GPU buffer.

Parameters
[in]bufferOffsetThe buffer offset to release.

◆ upload()

C3D_API void castor3d::GpuBufferPool::upload ( ashes::CommandBuffer const &  cb)

Uploads all ready memory ranges to VRAM.

Parameters
[in]cbThe command buffer on which transfer commands are recorded.

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