![]() |
Lysa
0.0
Lysa 3D Engine
|
Per-pipeline data for instances, draw command arrays, and culling.
Stores instance data, staging/copy buffers, and the compute pipeline used to perform frustum culling and produce culled indirect draws.
Public Member Functions | |
| GraphicPipelineData (uint32 pipelineId, const DeviceMemoryArray &meshInstancesDataArray, DeviceMemoryArray &instancesArray, uint32 maxMeshSurfacePerPipeline) | |
| void | addInstance (DeviceMemoryArray::WriteSession instancesWriteSession, const MeshInstance *meshInstance, const std::unordered_map< const MeshInstance *, MemoryBlock > &meshInstancesDataMemoryBlocks) |
| void | removeInstance (const MeshInstance *meshInstance) |
| void | addInstance (DeviceMemoryArray::WriteSession instancesWriteSession, const MeshInstance *meshInstance, const MemoryBlock &instanceMemoryBlock, const MemoryBlock &meshInstanceMemoryBlock) |
| void | updateInstance (DeviceMemoryArray::WriteSession instancesWriteSession, const MeshInstance *meshInstance, const std::unordered_map< const MeshInstance *, MemoryBlock > &meshInstancesDataMemoryBlocks) |
| void | updateData (const vireo::CommandList &commandList) |
Public Attributes | |
| pipeline_id | pipelineId |
| MaterialManager & | materialManager |
| std::shared_ptr< vireo::Vireo > | vireo |
| bool | instancesUpdated {false} |
| DeviceMemoryArray & | instancesArray |
| std::unordered_map< const MeshInstance *, MemoryBlock > | instancesMemoryBlocks |
| uint32 | activeInstancesCount {0} |
| std::vector< uint32 > | activeInstances |
| std::unordered_map< const MeshInstance *, uint32 > | instanceActiveIndex |
| std::shared_ptr< vireo::Buffer > | activeInstancesBuffer |
| std::shared_ptr< vireo::Buffer > | activeInstancesStagingBuffer |
| uint32 | drawCommandsCount {0} |
| std::shared_ptr< vireo::Buffer > | drawCommandsBuffer |
| std::shared_ptr< vireo::Buffer > | drawCommandsCountBuffer |
| std::shared_ptr< vireo::Buffer > | culledDrawCommandsBuffer |
| std::shared_ptr< vireo::Buffer > | culledDrawCommandsCountBuffer |
| GenerateDrawCommands | generateDrawCommandsPipeline |
| FrustumCulling | frustumCullingPipeline |
| GraphicPipelineData | ( | uint32 | pipelineId, |
| const DeviceMemoryArray & | meshInstancesDataArray, | ||
| DeviceMemoryArray & | instancesArray, | ||
| uint32 | maxMeshSurfacePerPipeline | ||
| ) |
Create a pipeline data object for a specific material/pipeline ID.
| pipelineId | Identifier of the pipeline. |
| meshInstancesDataArray | Array storing per-mesh-instance data. |
| instancesArray | |
| maxMeshSurfacePerPipeline | Maximum number of mesh surfaces supported by this pipeline. |
| void addInstance | ( | DeviceMemoryArray::WriteSession | instancesWriteSession, |
| const MeshInstance * | meshInstance, | ||
| const MemoryBlock & | instanceMemoryBlock, | ||
| const MemoryBlock & | meshInstanceMemoryBlock | ||
| ) |
Adds a single draw instance and wires memory blocks.
| instancesWriteSession | Write session for batch writing |
| meshInstance | Pointer to the mesh instance. |
| instanceMemoryBlock | Memory block for the instance data. |
| meshInstanceMemoryBlock | Memory block for the mesh instance data. |
| void addInstance | ( | DeviceMemoryArray::WriteSession | instancesWriteSession, |
| const MeshInstance * | meshInstance, | ||
| const std::unordered_map< const MeshInstance *, MemoryBlock > & | meshInstancesDataMemoryBlocks | ||
| ) |
Registers a mesh instance into this pipeline data object.
| meshInstance | Pointer to the mesh instance to add. |
| meshInstancesDataMemoryBlocks | Map of memory blocks for mesh instance data. |
| void removeInstance | ( | const MeshInstance * | meshInstance | ) |
Removes a previously registered mesh instance.
| meshInstance | Pointer to the mesh instance to remove. |
| void updateData | ( | const vireo::CommandList & | commandList | ) |
Uploads/refreshes GPU buffers and prepares culled draw arrays.
| commandList | Command buffer for GPU operations. |
| void updateInstance | ( | DeviceMemoryArray::WriteSession | instancesWriteSession, |
| const MeshInstance * | meshInstance, | ||
| const std::unordered_map< const MeshInstance *, MemoryBlock > & | meshInstancesDataMemoryBlocks | ||
| ) |
Updates the materialIndex of all surfaces for a registered mesh instance.
| instancesWriteSession | Write session for batch writing. |
| meshInstance | Pointer to the mesh instance to update. |
| meshInstancesDataMemoryBlocks | Map of memory blocks for mesh instance data. |
| std::vector<uint32> activeInstances |
CPU-side compact list of active instanceIndex values.
| std::shared_ptr<vireo::Buffer> activeInstancesBuffer |
GPU buffer holding the active instanceIndex list
| uint32 activeInstancesCount {0} |
Number of entries in activeInstances
| std::shared_ptr<vireo::Buffer> activeInstancesStagingBuffer |
Staging buffer for activeInstancesBuffer uploads
| std::shared_ptr<vireo::Buffer> culledDrawCommandsBuffer |
GPU buffer storing culled indirect draw commands.
| std::shared_ptr<vireo::Buffer> culledDrawCommandsCountBuffer |
GPU buffer storing the count of culled draw commands.
| std::shared_ptr<vireo::Buffer> drawCommandsBuffer |
GPU buffer storing indirect draw commands.
| uint32 drawCommandsCount {0} |
| std::shared_ptr<vireo::Buffer> drawCommandsCountBuffer |
GPU buffer storing the count of draw commands.
| FrustumCulling frustumCullingPipeline |
Compute pipeline used to cull draw commands against the frustum.
| GenerateDrawCommands generateDrawCommandsPipeline |
Compute pipeline used to generate draw commands.
| std::unordered_map<const MeshInstance*, uint32> instanceActiveIndex |
Mapping of meshes instances to the instanceIndex stored in activeInstances[]
| DeviceMemoryArray& instancesArray |
Device memory array that stores InstanceData blocks.
| std::unordered_map<const MeshInstance*, MemoryBlock> instancesMemoryBlocks |
Mapping of mesh instance to its memory block within instancesArray.
| bool instancesUpdated {false} |
Flag tracking if the instances set has been updated.
| MaterialManager& materialManager |
Reference to the material manager.
| pipeline_id pipelineId |
Identifier of the material/pipeline family.
| std::shared_ptr<vireo::Vireo> vireo |
Reference to Vireo.