Struct luminance::vertex::VertexAttribDesc [−][src]
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
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
Mutably borrows from an owned value. Read more