pub trait GetBatchData {
    type Param: SystemParam + 'static;
    type CompareData: PartialEq;
    type BufferData: GpuArrayBufferable + Sync + Send + 'static;

    // Required method
    fn get_batch_data(
        param: &SystemParamItem<'_, '_, Self::Param>,
        query_item: Entity
    ) -> Option<(Self::BufferData, Option<Self::CompareData>)>;
}
Expand description

A trait to support getting data used for batching draw commands via phase items.

Required Associated Types§

source

type Param: SystemParam + 'static

source

type CompareData: PartialEq

Data used for comparison between phase items. If the pipeline id, draw function id, per-instance data buffer dynamic offset and this data matches, the draws can be batched.

source

type BufferData: GpuArrayBufferable + Sync + Send + 'static

The per-instance data to be inserted into the GpuArrayBuffer containing these data for all instances.

Required Methods§

source

fn get_batch_data( param: &SystemParamItem<'_, '_, Self::Param>, query_item: Entity ) -> Option<(Self::BufferData, Option<Self::CompareData>)>

Get the per-instance data to be inserted into the GpuArrayBuffer. If the instance can be batched, also return the data used for comparison when deciding whether draws can be batched, else return None for the CompareData.

Object Safety§

This trait is not object safe.

Implementors§