Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | List of all members
castor3d::InstantiationComponent::ComponentData Struct Reference

#include <InstantiationComponent.hpp>

Inheritance diagram for castor3d::InstantiationComponent::ComponentData:
Inheritance graph
[legend]
Collaboration diagram for castor3d::InstantiationComponent::ComponentData:
Collaboration graph
[legend]

Public Member Functions

 ComponentData (Submesh &submesh, uint32_t threshold)
 
void gather (PipelineFlags const &flags, Pass const &pass, ObjectBufferOffset const &bufferOffsets, ashes::BufferCRefArray &buffers, castor::Vector< uint64_t > &offsets, ashes::PipelineVertexInputStateCreateInfoCRefArray &layouts, uint32_t &currentBinding, uint32_t &currentLocation) override
 Gathers buffers that need to go in a vertex layout.
 
void copy (SubmeshComponentDataRPtr data) const override
 Copies given component's data into this one.
 
C3D_API bool ref (Material const *material)
 Increments instance count.
 
C3D_API void unref (Material const *material)
 Decrements instance count.
 
C3D_API uint32_t getRefCount (Pass const &pass) const
 Retrieves the instances count.
 
C3D_API uint32_t getMaxRefCount () const
 
C3D_API InstanceDataMap::const_iterator find (Pass const &pass) const
 
C3D_API InstanceDataMap::iterator find (Pass const &pass)
 
uint32_t getThreshold () const
 
InstanceDataMap::const_iterator end () const
 
InstanceDataMap::iterator end ()
 
bool isInstanced (uint32_t count) const
 
- Public Member Functions inherited from castor3d::SubmeshComponentData
C3D_API SubmeshComponentData (Submesh &submesh)
 
C3D_API bool initialise (RenderDevice const &device)
 Initialises the submesh.
 
C3D_API void cleanup (RenderDevice const &device)
 Cleans the submesh.
 
C3D_API void upload (UploadData &uploader)
 Uploads data on VRAM.
 
virtual C3D_API VkBufferUsageFlags getUsageFlags () const noexcept
 
void needsUpdate ()
 
- Public Member Functions inherited from castor3d::SubmeshSubComponent
 SubmeshSubComponent ()=default
 
 SubmeshSubComponent (SubmeshSubComponent const &)=delete
 
SubmeshSubComponentoperator= (SubmeshSubComponent const &)=delete
 
C3D_API SubmeshSubComponent (SubmeshSubComponent &&) noexcept=default
 
C3D_API SubmeshSubComponentoperator= (SubmeshSubComponent &&) noexcept=default
 
virtual C3D_API ~SubmeshSubComponent () noexcept=default
 

Additional Inherited Members

- Protected Attributes inherited from castor3d::SubmeshComponentData
Submeshm_submesh
 

Constructor & Destructor Documentation

◆ ComponentData()

castor3d::InstantiationComponent::ComponentData::ComponentData ( Submesh & submesh,
uint32_t threshold )
explicit

Member Function Documentation

◆ copy()

void castor3d::InstantiationComponent::ComponentData::copy ( SubmeshComponentDataRPtr data) const
overridevirtual

Copies given component's data into this one.

Parameters
[in,out]dataThe source component's data.

Implements castor3d::SubmeshComponentData.

◆ end() [1/2]

InstanceDataMap::iterator castor3d::InstantiationComponent::ComponentData::end ( )
inline

◆ end() [2/2]

InstanceDataMap::const_iterator castor3d::InstantiationComponent::ComponentData::end ( ) const
inline

◆ find() [1/2]

C3D_API InstanceDataMap::iterator castor3d::InstantiationComponent::ComponentData::find ( Pass const & pass)

◆ find() [2/2]

C3D_API InstanceDataMap::const_iterator castor3d::InstantiationComponent::ComponentData::find ( Pass const & pass) const

name Getters.

◆ gather()

void castor3d::InstantiationComponent::ComponentData::gather ( PipelineFlags const & flags,
Pass const & pass,
ObjectBufferOffset const & bufferOffsets,
ashes::BufferCRefArray & buffers,
castor::Vector< uint64_t > & offsets,
ashes::PipelineVertexInputStateCreateInfoCRefArray & layouts,
uint32_t & currentBinding,
uint32_t & currentLocation )
overridevirtual

Gathers buffers that need to go in a vertex layout.

Parameters
[in]flagsThe pipeline flags.
[in]passThe material pass.
[in]bufferOffsetsHolds the buffers.
[in,out]buffersReceives the buffers.
[in,out]offsetsReceives the buffers offsets.
[in,out]layoutsReceives the vertex layouts.
[in,out]currentBindingThe current buffer binding.
[in,out]currentLocationThe current attribute location.

Implements castor3d::SubmeshComponentData.

◆ getMaxRefCount()

C3D_API uint32_t castor3d::InstantiationComponent::ComponentData::getMaxRefCount ( ) const
Returns
The maximum instances count, amongst all materials.

◆ getRefCount()

C3D_API uint32_t castor3d::InstantiationComponent::ComponentData::getRefCount ( Pass const & pass) const

Retrieves the instances count.

Parameters
[in]passThe material pass for which the instance count is retrieved
Returns
The value

◆ getThreshold()

uint32_t castor3d::InstantiationComponent::ComponentData::getThreshold ( ) const
inline

Referenced by isInstanced().

Here is the caller graph for this function:

◆ isInstanced()

bool castor3d::InstantiationComponent::ComponentData::isInstanced ( uint32_t count) const
inline

References getThreshold().

Here is the call graph for this function:

◆ ref()

C3D_API bool castor3d::InstantiationComponent::ComponentData::ref ( Material const * material)

Increments instance count.

Parameters
[in]materialThe material for which the instance count is incremented.
Returns
true if the instance buffer has changed.

◆ unref()

C3D_API void castor3d::InstantiationComponent::ComponentData::unref ( Material const * material)

Decrements instance count.

Parameters
[in]materialThe material for which the instance count is decremented.

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