Skip to main content

Vertex

Trait Vertex 

Source
pub trait Vertex {
    // Required method
    fn desc() -> VertexBufferLayout<'static>;
}
Expand description

Trait for types that describe their GPU vertex layout.

Required Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Vertex for InstanceRaw

As we store vertex data directly in the GPU memory we need to tell what the bytes refer to:

offset: zero as we want to use the full space. stride: length of a vertex

Stride layout here: position + rotation + scale as 4x4 matrix (hence the four 4d vectors)

Source§

impl Vertex for ModelVertex