Skip to main content

EffectCatalog

Trait EffectCatalog 

Source
pub trait EffectCatalog {
    // Required methods
    fn effect_definition(&self, id: &EffectId) -> Option<&EffectDef>;
    fn effect_reads_time(&self, id: &EffectId) -> bool;
    fn project_effect_id(&self, id: &str, version: u32) -> Option<&EffectId>;
}
Expand description

What a renderer can tell a graph builder about the effects it draws, without drawing anything: the GPU Renderer’s registry and the crate::CpuRenderer’s kernels answer from the same EffectDefs, so a frame compiles to the same graph whichever renderer draws it.

Required Methods§

Source

fn effect_definition(&self, id: &EffectId) -> Option<&EffectDef>

The definition registered as id.

Source

fn effect_reads_time(&self, id: &EffectId) -> bool

Whether what id draws can change with the frame time alone. An effect that is not registered answers true.

Source

fn project_effect_id(&self, id: &str, version: u32) -> Option<&EffectId>

The identity a project’s effect id at version is drawn under; None when this renderer cannot draw it, or it is an internal pass.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§