Castor3D 0.16.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 = castor::Vector< castor::RawUniquePtr< GpuBuddyBuffer > >
 

Public Member Functions

C3D_API GpuBufferPool (RenderDevice const &device, castor::String debugName)
 Constructor.
 
C3D_API void cleanup ()
 Cleans up all GPU buffers.
 
C3D_API void upload (UploadData &uploader) const
 Uploads all ready memory ranges to VRAM.
 
template<typename DataT >
GpuBufferOffsetT< DataT > getBuffer (VkBufferUsageFlags target, VkDeviceSize count, VkMemoryPropertyFlags flags)
 Retrieves a GPU buffer with the given size.
 
template<typename DataT >
void putBuffer (GpuBufferOffsetT< DataT > const &bufferOffset) noexcept
 Releases a GPU buffer.
 
- Public Member Functions inherited from castor::OwnedBy< RenderSystem >
RenderSystem * getOwner () const
 

Additional Inherited Members

- Protected Member Functions inherited from castor::OwnedBy< RenderSystem >
 OwnedBy (RenderSystem &owner)
 Constructor.
 

Member Typedef Documentation

◆ BufferArray

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)
noexcept

Releases a GPU buffer.

Parameters
[in]bufferOffsetThe buffer offset to release.

◆ upload()

C3D_API void castor3d::GpuBufferPool::upload ( UploadData & uploader) const

Uploads all ready memory ranges to VRAM.

Parameters
[in,out]uploaderReceives the upload requests.

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