pub struct MeshItemsBuffer {
pub(crate) vertices_buffer: WgpuVecBuffer<Vec3>,
pub(crate) mesh_ids_buffer: WgpuVecBuffer<u32>,
pub(crate) vertex_colors_buffer: WgpuVecBuffer<Rgba>,
pub(crate) vertex_normals_buffer: WgpuVecBuffer<Vec3>,
pub(crate) indices_buffer: WgpuVecBuffer<u32>,
pub(crate) transforms_buffer: WgpuVecBuffer<MeshTransform>,
pub(crate) item_count: u32,
pub(crate) total_vertices: u32,
pub(crate) total_indices: u32,
pub(crate) render_bind_group: Option<BindGroup>,
}Fields§
§vertices_buffer: WgpuVecBuffer<Vec3>Per-vertex positions (vertex buffer)
mesh_ids_buffer: WgpuVecBuffer<u32>Per-vertex mesh id (vertex buffer)
vertex_colors_buffer: WgpuVecBuffer<Rgba>Per-vertex colors (vertex buffer)
vertex_normals_buffer: WgpuVecBuffer<Vec3>Per-vertex normals (vertex buffer) — all-zero → flat shading fallback
indices_buffer: WgpuVecBuffer<u32>Merged triangle indices (index buffer)
transforms_buffer: WgpuVecBuffer<MeshTransform>Per-mesh transform matrices (storage buffer, indexed by mesh_id)
item_count: u32§total_vertices: u32§total_indices: u32§render_bind_group: Option<BindGroup>Implementations§
Source§impl MeshItemsBuffer
impl MeshItemsBuffer
pub fn new(ctx: &WgpuContext) -> Self
pub fn update(&mut self, ctx: &WgpuContext, mesh_items: &[MeshItem])
pub fn item_count(&self) -> u32
pub fn total_indices(&self) -> u32
pub fn vertex_buffer_layouts() -> [VertexBufferLayout<'static>; 4]
pub fn render_bind_group_layout(ctx: &WgpuContext) -> BindGroupLayout
fn create_render_bind_group(ctx: &WgpuContext, this: &Self) -> BindGroup
Auto Trait Implementations§
impl Freeze for MeshItemsBuffer
impl !RefUnwindSafe for MeshItemsBuffer
impl Send for MeshItemsBuffer
impl Sync for MeshItemsBuffer
impl Unpin for MeshItemsBuffer
impl !UnwindSafe for MeshItemsBuffer
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more