Castor3D 0.16.0
Multiplatform 3D engine
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
castor3d::StructuredShaderBuffer< ElementTypeTraits > Class Template Reference

Wrapper class to select between SSBO or TBO. More...

#include <StructuredShaderBuffer.hpp>

Collaboration diagram for castor3d::StructuredShaderBuffer< ElementTypeTraits >:
Collaboration graph
[legend]

Public Types

using ElementType = typename ElementTypeTraits::ElementType
 

Public Member Functions

C3D_API StructuredShaderBuffer (Engine &engine, ShaderBuffer &buffer, uint32_t &elementID, uint32_t count)
 Constructor.
 
C3D_API uint32_t add (ElementType &element)
 Adds an element to the buffer.
 
C3D_API void remove (ElementType &element)
 Removes an element from the buffer.
 
C3D_API void update ()
 Updates the buffer.
 
C3D_API void bind (uint32_t index) const
 Binds the buffer.
 

Static Public Attributes

static uint32_t constexpr ElementSize = ElementTypeTraits::ElementSize
 

Protected Attributes

ShaderBufferm_buffer
 
uint32_t & m_elementID
 
ElementTypeTraits m_traits
 
castor::Vector< ashes::AttributeFormat * > m_elements
 
castor::Vector< ashes::AttributeFormat const * > m_dirty
 
uint32_t const m_maxElemCount
 
castor::Vector< typename ElementType::OnChangedConnection > m_connections
 

Detailed Description

template<typename ElementTypeTraits>
class castor3d::StructuredShaderBuffer< ElementTypeTraits >

Wrapper class to select between SSBO or TBO.

Remarks
Allows to user either one or the other in the same way.

Member Typedef Documentation

◆ ElementType

template<typename ElementTypeTraits >
using castor3d::StructuredShaderBuffer< ElementTypeTraits >::ElementType = typename ElementTypeTraits::ElementType

Constructor & Destructor Documentation

◆ StructuredShaderBuffer()

template<typename ElementTypeTraits >
C3D_API castor3d::StructuredShaderBuffer< ElementTypeTraits >::StructuredShaderBuffer ( Engine & engine,
ShaderBuffer & buffer,
uint32_t & elementID,
uint32_t count )

Constructor.

Parameters
[in]engineThe engine.
[in]bufferThe shader buffer.
[in]elementIDThe ID for the next element to add.
[in]countThe maximum number of elements.

Member Function Documentation

◆ add()

template<typename ElementTypeTraits >
C3D_API uint32_t castor3d::StructuredShaderBuffer< ElementTypeTraits >::add ( ElementType & element)

Adds an element to the buffer.

Remarks
Sets the element's ID.
Parameters
[in]elementThe element.

◆ bind()

template<typename ElementTypeTraits >
C3D_API void castor3d::StructuredShaderBuffer< ElementTypeTraits >::bind ( uint32_t index) const

Binds the buffer.

Parameters
[in]indexThe binding point.

◆ remove()

template<typename ElementTypeTraits >
C3D_API void castor3d::StructuredShaderBuffer< ElementTypeTraits >::remove ( ElementType & element)

Removes an element from the buffer.

Parameters
[in]elementThe element.

◆ update()

template<typename ElementTypeTraits >
C3D_API void castor3d::StructuredShaderBuffer< ElementTypeTraits >::update ( )

Updates the buffer.

Member Data Documentation

◆ ElementSize

template<typename ElementTypeTraits >
uint32_t constexpr castor3d::StructuredShaderBuffer< ElementTypeTraits >::ElementSize = ElementTypeTraits::ElementSize
staticconstexpr

◆ m_buffer

template<typename ElementTypeTraits >
ShaderBuffer& castor3d::StructuredShaderBuffer< ElementTypeTraits >::m_buffer
protected

◆ m_connections

template<typename ElementTypeTraits >
castor::Vector< typename ElementType::OnChangedConnection > castor3d::StructuredShaderBuffer< ElementTypeTraits >::m_connections
protected

The connections to change signal for current elements.

◆ m_dirty

template<typename ElementTypeTraits >
castor::Vector< ashes::AttributeFormat const * > castor3d::StructuredShaderBuffer< ElementTypeTraits >::m_dirty
protected

The modified elements.

◆ m_elementID

template<typename ElementTypeTraits >
uint32_t& castor3d::StructuredShaderBuffer< ElementTypeTraits >::m_elementID
protected

The next element ID.

◆ m_elements

template<typename ElementTypeTraits >
castor::Vector< ashes::AttributeFormat * > castor3d::StructuredShaderBuffer< ElementTypeTraits >::m_elements
protected

The current elements.

◆ m_maxElemCount

template<typename ElementTypeTraits >
uint32_t const castor3d::StructuredShaderBuffer< ElementTypeTraits >::m_maxElemCount
protected

The maximum element count.

◆ m_traits

template<typename ElementTypeTraits >
ElementTypeTraits castor3d::StructuredShaderBuffer< ElementTypeTraits >::m_traits
protected

The traits.


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