Castor3D 0.12.0
Multiplatform 3D engine
Classes | Public Member Functions | Friends | List of all members
castor3d::GpuBufferBase Class Reference

#include <GpuBuffer.hpp>

Inheritance diagram for castor3d::GpuBufferBase:
Inheritance graph
[legend]

Public Member Functions

C3D_API GpuBufferBase (RenderSystem const &renderSystem, VkBufferUsageFlags usage, VkMemoryPropertyFlags memoryFlags, castor::String debugName, ashes::QueueShare sharingMode, VkDeviceSize allocatedSize, bool smallData=false)
 Constructor. More...
 
C3D_API void upload (ashes::CommandBuffer const &cb)
 Uploads all ready memory ranges to VRAM. More...
 
C3D_API void uploadDirect (ashes::Queue const &queue, ashes::CommandPool const &commandPool, VkDeviceSize offset, VkDeviceSize size, VkAccessFlags dstAccessFlags, VkPipelineStageFlags dstPipelineFlags)
 Uploads a memory range. More...
 
C3D_API void markDirty (VkDeviceSize offset, VkDeviceSize size, VkAccessFlags dstAccessFlags, VkPipelineStageFlags dstPipelineFlags)
 Marks a memory range to be ready for upload. More...
 
bool hasBuffer () const
 
ashes::Buffer< uint8_t > const & getBuffer () const
 
 operator ashes::Buffer< uint8_t > const & () const
 
ashes::Buffer< uint8_t > & getBuffer ()
 
 operator ashes::Buffer< uint8_t > & ()
 
template<typename DataT >
DataT const & getData (VkDeviceSize offset) const
 
template<typename DataT >
DataT & getData (VkDeviceSize offset)
 
castor::ArrayView< uint8_t > const & getDatas () const
 
castor::ArrayView< uint8_t > & getDatas ()
 

Friends

class GpuBufferPool
 

Constructor & Destructor Documentation

◆ GpuBufferBase()

C3D_API castor3d::GpuBufferBase::GpuBufferBase ( RenderSystem const &  renderSystem,
VkBufferUsageFlags  usage,
VkMemoryPropertyFlags  memoryFlags,
castor::String  debugName,
ashes::QueueShare  sharingMode,
VkDeviceSize  allocatedSize,
bool  smallData = false 
)

Constructor.

Parameters
[in]renderSystemThe 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]allocatedSizeThe buffer size.
[in]smallDataTells if the memory chunks allocated through this buffer are less than 65536 bytes.

Member Function Documentation

◆ getBuffer() [1/2]

ashes::Buffer< uint8_t > & castor3d::GpuBufferBase::getBuffer ( )
inline
Returns
The internal buffer.

◆ getBuffer() [2/2]

ashes::Buffer< uint8_t > const & castor3d::GpuBufferBase::getBuffer ( ) const
inline

◆ getData() [1/2]

template<typename DataT >
DataT & castor3d::GpuBufferBase::getData ( VkDeviceSize  offset)
inline
Returns
The N-th instance of the data.
Parameters
[in]offsetThe memory chunk offset.

◆ getData() [2/2]

template<typename DataT >
DataT const & castor3d::GpuBufferBase::getData ( VkDeviceSize  offset) const
inline
Returns
The N-th instance of the data.
Parameters
[in]offsetThe memory chunk offset.

◆ getDatas() [1/2]

castor::ArrayView< uint8_t > & castor3d::GpuBufferBase::getDatas ( )
inline
Returns
The data.

◆ getDatas() [2/2]

castor::ArrayView< uint8_t > const & castor3d::GpuBufferBase::getDatas ( ) const
inline

◆ hasBuffer()

bool castor3d::GpuBufferBase::hasBuffer ( ) const
inline
Returns
The internal buffer.

Referenced by castor3d::GpuBufferOffsetT< DataT >::operator bool().

Here is the caller graph for this function:

◆ markDirty()

C3D_API void castor3d::GpuBufferBase::markDirty ( VkDeviceSize  offset,
VkDeviceSize  size,
VkAccessFlags  dstAccessFlags,
VkPipelineStageFlags  dstPipelineFlags 
)

Marks a memory range to be ready for upload.

Parameters
[in]offset,sizeThe memory range.
[in]dstAccessFlagsThe access flags wanted after upload.
[in]dstPipelineFlagsThe pipeline stage flags wanted after upload.

Referenced by castor3d::ObjectBufferOffset::markBonesDirty(), castor3d::GpuBufferOffsetT< DataT >::markDirty(), castor3d::ObjectBufferOffset::markIndexDirty(), and castor3d::ObjectBufferOffset::markVertexDirty().

Here is the caller graph for this function:

◆ operator ashes::Buffer< uint8_t > &()

castor3d::GpuBufferBase::operator ashes::Buffer< uint8_t > & ( )
inline

◆ operator ashes::Buffer< uint8_t > const &()

castor3d::GpuBufferBase::operator ashes::Buffer< uint8_t > const & ( ) const
inline

◆ upload()

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

Uploads all ready memory ranges to VRAM.

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

◆ uploadDirect()

C3D_API void castor3d::GpuBufferBase::uploadDirect ( ashes::Queue const &  queue,
ashes::CommandPool const &  commandPool,
VkDeviceSize  offset,
VkDeviceSize  size,
VkAccessFlags  dstAccessFlags,
VkPipelineStageFlags  dstPipelineFlags 
)

Uploads a memory range.

Parameters
[in]queueThe queue to which the upload commands will be submitted to.
[in]commandPoolThe command pool from which the command buffer will be created.
[in]offset,sizeThe memory range.
[in]dstAccessFlagsThe access flags wanted after upload.
[in]dstPipelineFlagsThe pipeline stage flags wanted after upload.

Friends And Related Function Documentation

◆ GpuBufferPool

friend class GpuBufferPool
friend

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