pub fn new(pipeline: &BatchRenderPipeline) -> Self {
        let instance_desc = wgpu::BufferDescriptor {
            label: None,
            size: 0,
            usage: wgpu::BufferUsages::STORAGE | wgpu::BufferUsages::COPY_DST,
            mapped_at_creation: false,
        };

        let storage_layout = pipeline.pipeline.get_bind_group_layout(0);
        let texture_layout = pipeline.pipeline.get_bind_group_layout(1);
        let sampler_layout = pipeline.pipeline.get_bind_group_layout(2);

        BatchRenderer {
            instances: vec![],
            instance_desc,

            storage_layout,
            texture_layout,
            sampler_layout,

            storage_binds: BindCache::new(),
            texture_binds: BindCache::new(),
            sampler_binds: BindCache::new(),

            storage_slot: 0,
            texture_slot: 1,
            sampler_slot: 2,
        }
    }
/// Creates a new [BatchRenderer].
///
/// The renderer is not necessarily tied to [BatchRenderPipeline].
/// The pipeline handle only acts a reference pipeline layout.
Creates a new [BatchRenderer].
The renderer is not necessarily tied to [BatchRenderPipeline].
The pipeline handle only acts a reference pipeline layout.
Creates a new [ BatchRenderer ] . The renderer is not necessarily tied to [ BatchRenderPipeline ] . The pipeline handle only acts a reference pipeline layout .
pub fn new(pipeline: &BatchRenderPipeline) -> Self {
        let instance_desc = wgpu::BufferDescriptor {
            label: None,
            size: 0,
            usage: wgpu::BufferUsages::STORAGE | wgpu::BufferUsages::COPY_DST,
            mapped_at_creation: false,
        };
        let storage_layout = pipeline.pipeline.get_bind_group_layout(0);
        let texture_layout = pipeline.pipeline.get_bind_group_layout(1);
        let sampler_layout = pipeline.pipeline.get_bind_group_layout(2);
        BatchRenderer {
            instances: vec![],
            instance_desc,
            storage_layout,
            texture_layout,
            sampler_layout,
            storage_binds: BindCache::new(),
            texture_binds: BindCache::new(),
            sampler_binds: BindCache::new(),
            storage_slot: 0,
            texture_slot: 1,
            sampler_slot: 2,
        }
    }
pub fn new ( pipeline : & BatchRenderPipeline ) -> Self { let instance_desc = wgpu :: BufferDescriptor { label : None , size : 0 , usage : wgpu :: BufferUsages :: STORAGE | wgpu :: BufferUsages :: COPY_DST , mapped_at_creation : false , } ; let storage_layout = pipeline . pipeline . get_bind_group_layout ( 0 ) ; let texture_layout = pipeline . pipeline . get_bind_group_layout ( 1 ) ; let sampler_layout = pipeline . pipeline . get_bind_group_layout ( 2 ) ; BatchRenderer { instances : vec ! [ ] , instance_desc , storage_layout , texture_layout , sampler_layout , storage_binds : BindCache :: new ( ) , texture_binds : BindCache :: new ( ) , sampler_binds : BindCache :: new ( ) , storage_slot : 0 , texture_slot : 1 , sampler_slot : 2 , } }
Creates a new [BatchRenderer].
Creates a new [ BatchRenderer ] .
pipeline
&BatchRenderPipeline
pipeline
&BatchRenderPipeline