Castor3D 0.16.0
Multiplatform 3D engine
Classes | Public Types | Public Member Functions | List of all members
castor3d::ObjectBufferPool Class Reference

#include <ObjectBufferPool.hpp>

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

Classes

struct  ModelBuffers
 

Public Types

using BufferArray = castor::Vector< ModelBuffers >
 

Public Member Functions

C3D_API ObjectBufferPool (RenderDevice const &device, castor::String debugName)
 Constructor.
 
C3D_API void cleanup ()
 Cleans up all GPU buffers.
 
C3D_API ObjectBufferOffset getBuffer (VkDeviceSize vertexCount, VkDeviceSize indexCount, VkDeviceSize meshletCount, SubmeshComponentCombine const &components)
 Retrieves a GPU buffer with the given size.
 
C3D_API ObjectBufferOffset getBuffer (VkDeviceSize vertexCount, ashes::BufferBase const *indexBuffer, SubmeshComponentCombine const &components)
 Retrieves a GPU buffer with the given size.
 
C3D_API ModelBuffers const & getBuffers (ashes::BufferBase const &buffer)
 
C3D_API ashes::BufferBase const & getIndexBuffer (ashes::BufferBase const &buffer)
 
C3D_API void putBuffer (ObjectBufferOffset 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

◆ ObjectBufferPool()

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

Constructor.

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

Member Function Documentation

◆ cleanup()

C3D_API void castor3d::ObjectBufferPool::cleanup ( )

Cleans up all GPU buffers.

◆ getBuffer() [1/2]

C3D_API ObjectBufferOffset castor3d::ObjectBufferPool::getBuffer ( VkDeviceSize vertexCount,
ashes::BufferBase const * indexBuffer,
SubmeshComponentCombine const & components )

Retrieves a GPU buffer with the given size.

Parameters
[in]vertexCountThe wanted vertex count.
[in]indexBufferThe index buffer to link to the result.
[in]componentsThe components for which the result will have allocated buffers.
Returns
The GPU buffer.

◆ getBuffer() [2/2]

C3D_API ObjectBufferOffset castor3d::ObjectBufferPool::getBuffer ( VkDeviceSize vertexCount,
VkDeviceSize indexCount,
VkDeviceSize meshletCount,
SubmeshComponentCombine const & components )

Retrieves a GPU buffer with the given size.

Parameters
[in]vertexCountThe wanted vertex count.
[in]indexCountThe wanted index count.
[in]meshletCountThe wanted meshlet count.
[in]componentsThe components for which the result will have allocated buffers.
Returns
The GPU buffer.

◆ getBuffers()

C3D_API ModelBuffers const & castor3d::ObjectBufferPool::getBuffers ( ashes::BufferBase const & buffer)
Parameters
[in]bufferThe positions buffer.
Returns
The model buffers for the given positions buffer.

◆ getIndexBuffer()

C3D_API ashes::BufferBase const & castor3d::ObjectBufferPool::getIndexBuffer ( ashes::BufferBase const & buffer)
Parameters
[in]bufferThe positions buffer.
Returns
The index buffer linked to the given positions buffer.

◆ putBuffer()

C3D_API void castor3d::ObjectBufferPool::putBuffer ( ObjectBufferOffset const & bufferOffset)
noexcept

Releases a GPU buffer.

Parameters
[in]bufferOffsetThe buffer offset to release.

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