Struct luminance::vertex::VertexAttribDesc
source · [−]pub struct VertexAttribDesc {
pub ty: VertexAttribType,
pub dim: VertexAttribDim,
pub unit_size: usize,
pub align: usize,
}
Expand description
Vertex attribute format.
Vertex attributes (such as positions, colors, texture UVs, normals, etc.) have all a specific format that must be passed to the GPU. This type gathers information about a single vertex attribute and is completly agnostic of the rest of the attributes used to form a vertex.
A type is associated with a single value of type VertexAttribDesc
via the VertexAttrib
trait. If such an implementor exists for a type, it means that this type can be used as a vertex
attribute.
Fields
ty: VertexAttribType
Type of the attribute. See VertexAttribType
for further details.
dim: VertexAttribDim
Dimension of the attribute. It should be in 1–4. See VertexAttribDim
for further details.
unit_size: usize
Size in bytes that a single element of the attribute takes. That is, if your attribute has a dimension set to 2, then the unit size should be the size of a single element (not two).
align: usize
Alignment of the attribute. The best advice is to respect what Rust does, so it’s highly
recommended to use ::std::mem::align_of
to let it does the job for you.
Implementations
Trait Implementations
sourceimpl Clone for VertexAttribDesc
impl Clone for VertexAttribDesc
sourcefn clone(&self) -> VertexAttribDesc
fn clone(&self) -> VertexAttribDesc
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for VertexAttribDesc
impl Debug for VertexAttribDesc
sourceimpl Hash for VertexAttribDesc
impl Hash for VertexAttribDesc
sourceimpl PartialEq<VertexAttribDesc> for VertexAttribDesc
impl PartialEq<VertexAttribDesc> for VertexAttribDesc
sourcefn eq(&self, other: &VertexAttribDesc) -> bool
fn eq(&self, other: &VertexAttribDesc) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &VertexAttribDesc) -> bool
fn ne(&self, other: &VertexAttribDesc) -> bool
This method tests for !=
.
impl Copy for VertexAttribDesc
impl Eq for VertexAttribDesc
impl StructuralEq for VertexAttribDesc
impl StructuralPartialEq for VertexAttribDesc
Auto Trait Implementations
impl RefUnwindSafe for VertexAttribDesc
impl Send for VertexAttribDesc
impl Sync for VertexAttribDesc
impl Unpin for VertexAttribDesc
impl UnwindSafe for VertexAttribDesc
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more