wgpu-noboiler 0.1.2

A simplified Api for wgpu and winit
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::mem;

use wgpu::{BufferAddress, VertexAttribute, VertexBufferLayout, VertexStepMode};

pub trait Vertex<const SIZE: usize> {

    fn descriptor<'a>() -> VertexBufferLayout<'a> where Self: Sized {
        VertexBufferLayout {
            array_stride: mem::size_of::<Self>() as BufferAddress,
            step_mode: VertexStepMode::Vertex,
            attributes: &Self::ATTRIBS,
        }
    }
    const ATTRIBS: [VertexAttribute; SIZE];
}