pub struct Mesh { /* private fields */ }
Implementations§
source§impl Mesh
impl Mesh
sourcepub fn new<V: Vertex>(
device: &Device,
vertex_data: &[V],
index_data: &[Index]
) -> Self
pub fn new<V: Vertex>( device: &Device, vertex_data: &[V], index_data: &[Index] ) -> Self
Create a new mesh from vertices and indices
sourcepub fn draw<'m: 'p, 'p>(&'m self, pass: &mut RenderPass<'p>)
pub fn draw<'m: 'p, 'p>(&'m self, pass: &mut RenderPass<'p>)
Draw a single instance of this mesh, using slot 0 for the vertex buffer.
Ideally use draw_instanced
.
sourcepub fn draw_instanced<'m: 'p, 'p>(
&'m self,
pass: &mut RenderPass<'p>,
instances: Range<u32>
)
pub fn draw_instanced<'m: 'p, 'p>( &'m self, pass: &mut RenderPass<'p>, instances: Range<u32> )
Draw multiple instances of this mesh, the instance buffer must be bound already.
Slot 0 is used for the vertex buffer
Drawing indirectly can have greater performance, use bind
and call whichever indirect drawing function you need.
sourcepub fn bind<'m: 'p, 'p>(&'m self, pass: &mut RenderPass<'p>, slot: u32)
pub fn bind<'m: 'p, 'p>(&'m self, pass: &mut RenderPass<'p>, slot: u32)
Bind this mesh’s buffers for drawing
Auto Trait Implementations§
impl !Freeze for Mesh
impl !RefUnwindSafe for Mesh
impl Send for Mesh
impl Sync for Mesh
impl Unpin for Mesh
impl !UnwindSafe for Mesh
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