pub struct Mesh<B: Backend> { /* private fields */ }
Expand description
Single mesh is a collection of buffer ranges that provides available attributes. Usually exactly one mesh is used per draw call.
Implementations§
Source§impl<B> Mesh<B>where
B: Backend,
impl<B> Mesh<B>where
B: Backend,
Sourcepub fn builder<'a>() -> MeshBuilder<'a>
pub fn builder<'a>() -> MeshBuilder<'a>
Build new mesh with MeshBuilder
Sourcepub fn len(&self) -> u32
pub fn len(&self) -> u32
Returns the number of vertices that will be drawn in the mesh. For a mesh with no index buffer, this is the same as the number of vertices, or for a mesh with indices, this is the same as the number of indices.
Sourcepub fn bind<C>(
&self,
first_binding: u32,
formats: &[VertexFormat],
encoder: &mut EncoderCommon<'_, B, C>,
) -> Result<u32, Incompatible>
pub fn bind<C>( &self, first_binding: u32, formats: &[VertexFormat], encoder: &mut EncoderCommon<'_, B, C>, ) -> Result<u32, Incompatible>
Bind buffers to specified attribute locations.
Sourcepub fn bind_and_draw(
&self,
first_binding: u32,
formats: &[VertexFormat],
instance_range: Range<u32>,
encoder: &mut RenderPassEncoder<'_, B>,
) -> Result<u32, Incompatible>
pub fn bind_and_draw( &self, first_binding: u32, formats: &[VertexFormat], instance_range: Range<u32>, encoder: &mut RenderPassEncoder<'_, B>, ) -> Result<u32, Incompatible>
Bind buffers to specified attribute locations and issue draw calls with given instance range.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Mesh<B>
impl<B> RefUnwindSafe for Mesh<B>
impl<B> Send for Mesh<B>
impl<B> Sync for Mesh<B>
impl<B> Unpin for Mesh<B>
impl<B> UnwindSafe for Mesh<B>
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