/// Creates a new [MeshRenderer].
///
/// The renderer is not necessarily tied to [MeshRenderPipeline].
/// The pipeline handle only acts a reference pipeline layout.
Creates a new [MeshRenderer].
The renderer is not necessarily tied to [MeshRenderPipeline].
The pipeline handle only acts a reference pipeline layout.
Creates a new [ MeshRenderer ] . The renderer is not necessarily tied to [ MeshRenderPipeline ] . The pipeline handle only acts a reference pipeline layout .
pub fn new(cx: &Context, pipeline: &MeshRenderPipeline) -> Self {
        let uniforms = GrowingBufferArena::new(
            cx,
            wgpu::BufferDescriptor {
                label: None,
                size: cx.pad_uniform_size(GpuDraw::std430_size_static() as _) * 1024,
                usage: wgpu::BufferUsages::UNIFORM | wgpu::BufferUsages::COPY_DST,
                mapped_at_creation: false,
            },
        );
        let uniform_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);
        MeshRenderer {
            uniforms,
            uniform_layout,
            texture_layout,
            sampler_layout,
            uniform_binds: BindCache::new(),
            texture_binds: BindCache::new(),
            sampler_binds: BindCache::new(),
            uniform_slot: 0,
            texture_slot: 1,
            sampler_slot: 2,
        }
    }
pub fn new ( cx : & Context , pipeline : & MeshRenderPipeline ) -> Self { let uniforms = GrowingBufferArena :: new ( cx , wgpu :: BufferDescriptor { label : None , size : cx . pad_uniform_size ( GpuDraw :: std430_size_static ( ) as _ ) * 1024 , usage : wgpu :: BufferUsages :: UNIFORM | wgpu :: BufferUsages :: COPY_DST , mapped_at_creation : false , } , ) ; let uniform_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 ) ; MeshRenderer { uniforms , uniform_layout , texture_layout , sampler_layout , uniform_binds : BindCache :: new ( ) , texture_binds : BindCache :: new ( ) , sampler_binds : BindCache :: new ( ) , uniform_slot : 0 , texture_slot : 1 , sampler_slot : 2 , } }
Creates a new [MeshRenderer].
Creates a new [ MeshRenderer ] .
cx
&Context
pipeline
&MeshRenderPipeline