RenderData

Trait RenderData 

Source
pub trait RenderData {
    type Params: SystemParam;

    // Required method
    fn describe(
        params: &mut SystemParamItem<'_, '_, Self::Params>,
        builder: &mut RenderDataBuilder,
    );

    // Provided method
    fn recreate(_params: &SystemParamItem<'_, '_, Self::Params>) -> Option<bool> { ... }
}
Expand description

A trait for describing render data.

This trait is used to declare buffers and textures that should be created on the GPU. The struct implementing this trait should usually derive [Asset], [TypePath] and Clone so it can be registered through RenderDataRegisterPlugin.

The prepared GPU side can then be retrieved in render systems through GpuRenderData, using the binding indices specified in RenderData::describe.

Required Associated Types§

Source

type Params: SystemParam

Required Methods§

Source

fn describe( params: &mut SystemParamItem<'_, '_, Self::Params>, builder: &mut RenderDataBuilder, )

Describes the render data by adding buffers and textures to the builder.

This is called during initialization, and when recreate returns Some(true).

Provided Methods§

Source

fn recreate(_params: &SystemParamItem<'_, '_, Self::Params>) -> Option<bool>

Whether the gpu asset should be recreated. This is called every frame. The default is to never recreate (None).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§