pub struct LineVariant {
pub surface: SurfaceKey,
pub options: LineOptions,
}Expand description
The pipeline variant a line draw resolves to.
The target decides the surface, and the options decide the rest. Two options that differ only where the pipeline cannot see — the snippets’ names among them — are two variants, because a pipeline built for one draws differently than one built for the other.
A difference that would change nothing is folded instead: on a single-sampled target the antialiasing hint says nothing, so two options that differ only in it share the one variant.
One difference the target does reach is the antialiasing: on a multisampled target the variant drops the hard-edge cut, and it turns the fragment’s alpha into the alpha-to-coverage sample mask when the options hint that the alpha states coverage, so an options’ hard-edge word holds only on a single-sampled one.
Fields§
§surface: SurfaceKeyThe target the stroke is drawn into.
options: LineOptionsThe caller’s policy for the stroke.
Implementations§
Source§impl LineVariant
impl LineVariant
Sourcefn features(&self) -> [(&'static str, bool); 1]
fn features(&self) -> [(&'static str, bool); 1]
The conditional-compilation flags the variant’s shader module composes with. The hard-edge cut is the one flag a line variant carries, and it holds only where no samples antialias in its place: a multisampled target leaves the edge to its samples — smoothed by alpha-to-coverage when the options hint at it — so the cut is left to a single-sampled one.
Trait Implementations§
Source§impl Clone for LineVariant
impl Clone for LineVariant
Source§impl Debug for LineVariant
impl Debug for LineVariant
impl Eq for LineVariant
Source§impl Hash for LineVariant
impl Hash for LineVariant
Source§impl PartialEq for LineVariant
impl PartialEq for LineVariant
Source§impl PipelineDescriptor<RenderPipeline> for LineVariant
impl PipelineDescriptor<RenderPipeline> for LineVariant
Source§impl PipelineVariant<RenderPipeline> for LineVariant
impl PipelineVariant<RenderPipeline> for LineVariant
Source§type Descriptor = LineVariant
type Descriptor = LineVariant
Source§fn descriptor(&self, _device: &Device) -> Self
fn descriptor(&self, _device: &Device) -> Self
impl StructuralPartialEq for LineVariant
Auto Trait Implementations§
impl Forget for LineVariant
impl Freeze for LineVariant
impl RefUnwindSafe for LineVariant
impl Send for LineVariant
impl Sync for LineVariant
impl Unpin for LineVariant
impl UnsafeUnpin for LineVariant
impl UnwindSafe for LineVariant
Blanket Implementations§
impl<T> AsId for T
impl<T> AsIdSalt for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more