![]() |
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, size_t initialCapacity) | |
| 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) |
| GraphicPipelineData | ( | uint32 | pipelineId, |
| const DeviceMemoryArray & | meshInstancesDataArray, | ||
| DeviceMemoryArray & | instancesArray, | ||
| size_t | initialCapacity | ||
| ) |
Create a pipeline data object for a specific material/pipeline ID.
| pipelineId | Identifier of the pipeline. |
| meshInstancesDataArray | Array storing per-mesh-instance data. |
| instancesArray | |
| initialCapacity | Initial group and draw capacities, grown independently on demand. |
| 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<InstanceGroupData> activeInstances |
CPU-side compact list of mesh/pipeline surface groups.
| 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
| vireo::ResourceState activeInstancesState {vireo::ResourceState::UNDEFINED} |
| 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> drawCommandGroupsBuffer |
GPU ranges of commands belonging to each mesh/pipeline group.
| std::shared_ptr<vireo::Buffer> drawCommandsBuffer |
GPU buffer storing generated surface 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.
| const DeviceMemoryArray& meshInstancesDataArray |
Persistent per-mesh data array.
| pipeline_id pipelineId |
Identifier of the material/pipeline family.
| std::shared_ptr<vireo::Vireo> vireo |
Reference to Vireo.