pub trait PipelineVariant<P>:
Clone
+ Hash
+ Eq
+ 'static {
type Descriptor: PipelineDescriptor<P>;
// Required method
fn descriptor(&self, device: &Device) -> Self::Descriptor;
}Expand description
The complete, hashable identity of one compiled pipeline, and the recipe for its blueprint.
This is the cache key, so it carries exactly the information the descriptor depends on – no more, no less – and must be injective: equal variants build equal descriptors, and draws whose descriptors differ resolve to different variants. Equal keys then share one compiled pipeline, which is why Variants needs only a single map.
A variant may be its own descriptor (type Descriptor = Self), as the
built-in lit family does, or describe a larger one it does not own.
Required Associated Types§
Sourcetype Descriptor: PipelineDescriptor<P>
type Descriptor: PipelineDescriptor<P>
The blueprint this variant compiles.
Required Methods§
Sourcefn descriptor(&self, device: &Device) -> Self::Descriptor
fn descriptor(&self, device: &Device) -> Self::Descriptor
Build this variant’s blueprint. Called only on a cache miss.
device is there for variants whose blueprint depends on device
capabilities; the cache itself is built for one device.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".