Skip to main content

allocate_material

Function allocate_material 

Source
fn allocate_material(
    world: &mut World,
    descriptor: SamplerDescriptor<'static>,
    build_texture: impl FnOnce(&MeshSource, &Scope<'_>) -> Texture,
) -> RenderEntity
Expand description

Allocate one material in the render world from a texture built on its device, and answer its asset entity.

It builds a texture, registers it with a default view and a sampler, then allocates the material. Panics inside the render world when it carries no MeshSource.