Function collect_buffers_for_phase

Source
pub fn collect_buffers_for_phase<PI, GFBD>(
    phase_batched_instance_buffers: ResMut<'_, PhaseBatchedInstanceBuffers<PI, GFBD::BufferData>>,
    phase_indirect_parameters_buffers: ResMut<'_, PhaseIndirectParametersBuffers<PI>>,
    batched_instance_buffers: ResMut<'_, BatchedInstanceBuffers<GFBD::BufferData, GFBD::BufferInputData>>,
    indirect_parameters_buffers: ResMut<'_, IndirectParametersBuffers>,
)
where PI: PhaseItem, GFBD: GetFullBatchData + Send + Sync + 'static,
Expand description

A system that gathers up the per-phase GPU buffers and inserts them into the BatchedInstanceBuffers and IndirectParametersBuffers tables.

This runs after the batch_and_prepare_binned_render_phase or batch_and_prepare_sorted_render_phase systems. It takes the per-phase PhaseBatchedInstanceBuffers and PhaseIndirectParametersBuffers resources and inserts them into the global BatchedInstanceBuffers and IndirectParametersBuffers tables.

This system exists so that the batch_and_prepare_binned_render_phase and batch_and_prepare_sorted_render_phase can run in parallel with one another. If those two systems manipulated BatchedInstanceBuffers and IndirectParametersBuffers directly, then they wouldn’t be able to run in parallel.