Skip to main content

SurfaceTarget

Trait SurfaceTarget 

Source
pub trait SurfaceTarget {
    // Required method
    fn set_surface(&mut self, surface: SurfaceKey);
}
Expand description

A descriptor whose pipeline is only valid for one render target.

A pipeline’s color format, sample count and depth-stencil format must match the attachments its pass renders into, so a descriptor that names them has to be rewritten when the target changes. Implementing this lets a variant apply a SurfaceKey to the blueprint it builds, whichever kind of pipeline it compiles; the framework itself neither knows nor caches the target.

Required Methods§

Source

fn set_surface(&mut self, surface: SurfaceKey)

Rewrite this descriptor’s target-dependent fields for surface.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§