pub struct LitVertexChannels {
pub position: PositionStreamChannels,
pub secondary: SecondaryFlags,
}Expand description
The per-vertex channels the built-in shader variant reads.
These are not part of LitOptions: they are a property of the geometry
rather than of anything a caller picks, so a pipeline reads them off the
vertex buffers its draws are recorded with — every draw of a mesh carries
the channels that mesh’s buffers hold, so there is nothing to specialize on
and nothing for a caller to get wrong. A family resolves them into
LitVariant::channels.
The two halves are crate::mesh’s own channel types, so the attributes a
pipeline declares and the bytes a packed mesh writes come from one
description and cannot drift apart.
Fields§
§position: PositionStreamChannelsThe position stream: whether it carries a position at all — and in which encoding — plus the joint pair that rides along with it.
A stream with no position leaves the geometry a single point at the instance origin, which is what point, particle and impostor draws want: the per-instance data alone places the vertex.
secondary: SecondaryFlagsThe secondary stream’s channels: a UV in either encoding, a vertex color, a normal, or any combination.
Implementations§
Source§impl LitVertexChannels
impl LitVertexChannels
Sourcepub const fn empty() -> Self
pub const fn empty() -> Self
The channels of a layout that carries none: no position, no joints, and an empty secondary stream.
A variant built from this reads no per-vertex attribute at all — the
geometry is a single point at the instance origin — which is what point,
particle and impostor draws want. The instance record is unconditional,
so a VertexInput struct always has members.
Sourcepub fn for_vertex_buffer(slot: u32, layout: &VertexBufferLayoutDesc) -> Self
pub fn for_vertex_buffer(slot: u32, layout: &VertexBufferLayoutDesc) -> Self
The channels one vertex-buffer slot carries.
A channel is identified by its shader location, which is stable across
variants. Only the built-in pipeline’s own slots are read —
PRIMARY_SLOT and SECONDARY_SLOT — so any other slot, the
per-instance one included, contributes nothing.
Sourcepub fn for_vertex_layout(layout: &[(u32, VertexBufferLayoutDesc)]) -> Self
pub fn for_vertex_layout(layout: &[(u32, VertexBufferLayoutDesc)]) -> Self
The channels a whole vertex layout carries: the union of
Self::for_vertex_buffer over layout’s slots.
Trait Implementations§
Source§impl Clone for LitVertexChannels
impl Clone for LitVertexChannels
impl Copy for LitVertexChannels
Source§impl Debug for LitVertexChannels
impl Debug for LitVertexChannels
impl Eq for LitVertexChannels
Source§impl Hash for LitVertexChannels
impl Hash for LitVertexChannels
Source§impl PartialEq for LitVertexChannels
impl PartialEq for LitVertexChannels
impl StructuralPartialEq for LitVertexChannels
Auto Trait Implementations§
impl Forget for LitVertexChannels
impl Freeze for LitVertexChannels
impl RefUnwindSafe for LitVertexChannels
impl Send for LitVertexChannels
impl Sync for LitVertexChannels
impl Unpin for LitVertexChannels
impl UnsafeUnpin for LitVertexChannels
impl UnwindSafe for LitVertexChannels
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