Compute pipeline that generates DrawCommand entries for a Scene entirely on the GPU.
|
| | GenerateDrawCommands (pipeline_id pipelineId, const vireo::Buffer &activeInstancesBuffer, const DeviceMemoryArray &instancesArray, const DeviceMemoryArray &meshInstancesArray, const vireo::Buffer &drawCommandsBuffer, const vireo::Buffer &drawCommandsCountBuffer, const vireo::Buffer &drawCommandGroupsBuffer) |
| |
| void | dispatch (vireo::CommandList &commandList, uint32 activeInstancesCount, const std::shared_ptr< const GlobalResourcesGeneration > &globalResources) |
| |
| void | updateBuffers (const DeviceMemoryArray &instancesArray, const DeviceMemoryArray &meshInstancesArray, const vireo::Buffer &activeInstances, const vireo::Buffer &commands, const vireo::Buffer &groups) |
| |
| virtual | ~GenerateDrawCommands () = default |
| |
| | GenerateDrawCommands (GenerateDrawCommands &) = delete |
| |
| GenerateDrawCommands & | operator= (GenerateDrawCommands &) = delete |
| |
| GenerateDrawCommands |
( |
pipeline_id |
pipelineId, |
|
|
const vireo::Buffer & |
activeInstancesBuffer, |
|
|
const DeviceMemoryArray & |
instancesArray, |
|
|
const DeviceMemoryArray & |
meshInstancesArray, |
|
|
const vireo::Buffer & |
drawCommandsBuffer, |
|
|
const vireo::Buffer & |
drawCommandsCountBuffer, |
|
|
const vireo::Buffer & |
drawCommandGroupsBuffer |
|
) |
| |
Constructs a GpuDrawSetup pipeline.
- Parameters
-
| pipelineId | Identifier of the parent material pipeline (debug names). |
| activeInstancesBuffer | GPU buffer of active mesh/pipeline groups |
| instancesArray | Global instances buffer |
| meshInstancesArray | Scene meshInstances buffer |
| drawCommandsBuffer | Output DrawCommand buffer. |
| drawCommandsCountBuffer | Atomic counter buffer, reset each frame. |
| virtual ~GenerateDrawCommands |
( |
| ) |
|
|
virtualdefault |
| GenerateDrawCommands |
( |
GenerateDrawCommands & |
| ) |
|
|
delete |
Releases shared (static) GPU resources. Call once at shutdown.
| void dispatch |
( |
vireo::CommandList & |
commandList, |
|
|
uint32 |
activeInstancesCount, |
|
|
const std::shared_ptr< const GlobalResourcesGeneration > & |
globalResources |
|
) |
| |
Clears the counter then dispatches the compute shader.
- Parameters
-
| commandList | Command list to record into. |
| activeInstancesCount | Number of entries in activeInstancesBuffer. |
| GenerateDrawCommands& operator= |
( |
GenerateDrawCommands & |
| ) |
|
|
delete |
| void updateBuffers |
( |
const DeviceMemoryArray & |
instancesArray, |
|
|
const DeviceMemoryArray & |
meshInstancesArray, |
|
|
const vireo::Buffer & |
activeInstances, |
|
|
const vireo::Buffer & |
commands, |
|
|
const vireo::Buffer & |
groups |
|
) |
| |
Rebind scene and output arrays after growth.