Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
InstanceDataSoA Struct Reference

CPU-side representation of batch-rendering instances organized as a Structure of Arrays. More...

#include <VulkanRenderer.hpp>

Public Member Functions

void clear ()
 Clears all array allocations.
size_t push (const InstanceData &inst)
 Appends a new instance.
size_t size () const
 Retrieves total active instance count.
InstanceDataGPU get (size_t i) const
 Retrieves CPU instancing details at index formatted for GPU.

Public Attributes

std::vector< glm::mat4 > models
 Model matrices of all instances.
std::vector< uint32_t > materialIDs
 Material IDs of all instances.
std::vector< uint32_t > meshIDs
 Mesh IDs of all instances.
std::vector< glm::vec4 > colors
 Colors of all instances.

Detailed Description

CPU-side representation of batch-rendering instances organized as a Structure of Arrays.

Member Function Documentation

◆ clear()

void InstanceDataSoA::clear ( )
inline

Clears all array allocations.

◆ get()

InstanceDataGPU InstanceDataSoA::get ( size_t i) const
inline

Retrieves CPU instancing details at index formatted for GPU.

Parameters
iArray index.
Returns
GPU format instance data.

◆ push()

size_t InstanceDataSoA::push ( const InstanceData & inst)
inline

Appends a new instance.

Parameters
instInstance parameters.
Returns
Index of the new instance.

◆ size()

size_t InstanceDataSoA::size ( ) const
inline

Retrieves total active instance count.

Returns
Instance count.

Member Data Documentation

◆ colors

std::vector<glm::vec4> InstanceDataSoA::colors

Colors of all instances.

◆ materialIDs

std::vector<uint32_t> InstanceDataSoA::materialIDs

Material IDs of all instances.

◆ meshIDs

std::vector<uint32_t> InstanceDataSoA::meshIDs

Mesh IDs of all instances.

◆ models

std::vector<glm::mat4> InstanceDataSoA::models

Model matrices of all instances.


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