pub struct VertexLayout {
pub array_stride: BufferAddress,
pub step_mode: VertexStepMode,
pub attributes: Vec<VertexAttribute>,
}Expand description
One vertex buffer’s layout, owned so a RenderPipelineDesc can be stored,
cloned, hashed and sent to the warm-up worker.
The borrowed wgpu::VertexBufferLayout this converts to
(VertexLayout::as_wgpu) is built only for the duration of the
create_render_pipeline call.
Fields§
§array_stride: BufferAddressStride in bytes between consecutive elements.
step_mode: VertexStepModeWhether the buffer steps per vertex or per instance.
attributes: Vec<VertexAttribute>The attributes making up one element.
Implementations§
Source§impl VertexLayout
impl VertexLayout
Sourcepub fn per_vertex(
array_stride: BufferAddress,
attributes: Vec<VertexAttribute>,
) -> Self
pub fn per_vertex( array_stride: BufferAddress, attributes: Vec<VertexAttribute>, ) -> Self
A layout stepped per vertex (the common case) over attributes.
Sourcepub fn as_wgpu(&self) -> VertexBufferLayout<'_>
pub fn as_wgpu(&self) -> VertexBufferLayout<'_>
The borrowed wgpu view of this layout.
Trait Implementations§
Source§impl Clone for VertexLayout
impl Clone for VertexLayout
Source§impl Debug for VertexLayout
impl Debug for VertexLayout
Source§impl Default for VertexLayout
impl Default for VertexLayout
impl Eq for VertexLayout
Source§impl Hash for VertexLayout
impl Hash for VertexLayout
Source§impl PartialEq for VertexLayout
impl PartialEq for VertexLayout
impl StructuralPartialEq for VertexLayout
Auto Trait Implementations§
impl Freeze for VertexLayout
impl RefUnwindSafe for VertexLayout
impl Send for VertexLayout
impl Sync for VertexLayout
impl Unpin for VertexLayout
impl UnsafeUnpin for VertexLayout
impl UnwindSafe for VertexLayout
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.