pub struct VertexFormat {
pub stride: u32,
pub attributes: Vec<Attribute>,
}
Expand description
Vertex format contains information to initialize graphics pipeline Attributes must be sorted by offset.
Fields§
§stride: u32
Size of single vertex.
attributes: Vec<Attribute>
Attributes for format.
Implementations§
Source§impl VertexFormat
impl VertexFormat
Sourcepub fn new<I>(attrs: I) -> VertexFormatwhere
I: AsAttributes,
pub fn new<I>(attrs: I) -> VertexFormatwhere
I: AsAttributes,
Create new vertex format with specified attributes. The max attribute offset and format size is used to calculate the stricde.
Sourcepub fn with_stride<I>(attrs: I, stride: u32) -> VertexFormatwhere
I: AsAttributes,
pub fn with_stride<I>(attrs: I, stride: u32) -> VertexFormatwhere
I: AsAttributes,
Create new vertex format with specified attributes and manually specified stride.
Sourcepub fn gfx_vertex_input_desc(
&self,
rate: VertexInputRate,
) -> (Vec<Element<Format>>, u32, VertexInputRate)
pub fn gfx_vertex_input_desc( &self, rate: VertexInputRate, ) -> (Vec<Element<Format>>, u32, VertexInputRate)
Convert into gfx digestible type.
Trait Implementations§
Source§impl AsAttributes for VertexFormat
impl AsAttributes for VertexFormat
Source§fn attributes(self) -> <VertexFormat as AsAttributes>::Iter
fn attributes(self) -> <VertexFormat as AsAttributes>::Iter
Retreive a list of vertex attributes with offsets relative to beginning of that list
Source§impl Clone for VertexFormat
impl Clone for VertexFormat
Source§fn clone(&self) -> VertexFormat
fn clone(&self) -> VertexFormat
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for VertexFormat
impl Debug for VertexFormat
Source§impl Hash for VertexFormat
impl Hash for VertexFormat
Source§impl Ord for VertexFormat
impl Ord for VertexFormat
Source§fn cmp(&self, other: &VertexFormat) -> Ordering
fn cmp(&self, other: &VertexFormat) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for VertexFormat
impl PartialEq for VertexFormat
Source§impl PartialOrd for VertexFormat
impl PartialOrd for VertexFormat
impl Eq for VertexFormat
impl StructuralPartialEq for VertexFormat
Auto Trait Implementations§
impl Freeze for VertexFormat
impl RefUnwindSafe for VertexFormat
impl Send for VertexFormat
impl Sync for VertexFormat
impl Unpin for VertexFormat
impl UnwindSafe for VertexFormat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)