pub struct GpuMesh {
pub label: String,
pub ssbo_first_vertex: u32,
pub ssbo_first_index: u32,
pub use_ssbo: bool,
pub vertex_buffer: Option<Buffer>,
pub index_buffer: Option<Buffer>,
pub index_count: u32,
pub bounding_box: MeshBbox,
}Expand description
Represents a GPU mesh resource allocated from a CPU Mesh asset.
If the mesh was prepared with use_ssbo = true, the vertex and index data will be in the SSBO mesh buffer SsboMesh and the vertex_buffer and index_buffer fields will be None. Otherwhise, they will contain GPU buffers with the vertex and index data respectively.
Fields§
§label: String§ssbo_first_vertex: u32Offset to the vertex buffer in the SsboMesh if use_ssbo is true. 0 otherwise.
ssbo_first_index: u32Offset to the index buffer in the SsboMesh if use_ssbo is true. 0 otherwise.
use_ssbo: bool§vertex_buffer: Option<Buffer>If not using SSBO, the GPU vertex buffer containing Vertex data. None if use_ssbo is true.
index_buffer: Option<Buffer>If not using SSBO, the GPU index buffer containing u32 index data. None if use_ssbo is true.
index_count: u32§bounding_box: MeshBboxTrait Implementations§
Source§impl RenderAsset for GpuMesh
impl RenderAsset for GpuMesh
type SourceAsset = Mesh
type Params = (Res<'static, RenderInstance>, ResMut<'static, SsboMeshDescriptor>, Res<'static, RenderAssets<GpuRenderData<SsboMesh>>>, Res<'static, RenderAssets<GpuBuffer>>)
Source§fn prepare(
asset: Self::SourceAsset,
(render_instance, ssbo_descriptor, ssbo_mesh, gpu_buffers): &mut SystemParamItem<'_, '_, Self::Params>,
) -> Result<Self, PrepareAssetError<Self::SourceAsset>>
fn prepare( asset: Self::SourceAsset, (render_instance, ssbo_descriptor, ssbo_mesh, gpu_buffers): &mut SystemParamItem<'_, '_, Self::Params>, ) -> Result<Self, PrepareAssetError<Self::SourceAsset>>
Prepare the GPU asset from the CPU source [bevy::prelude::Asset] using the render-world system params.
fn label(&self) -> &str
Auto Trait Implementations§
impl Freeze for GpuMesh
impl !RefUnwindSafe for GpuMesh
impl Send for GpuMesh
impl Sync for GpuMesh
impl Unpin for GpuMesh
impl !UnwindSafe for GpuMesh
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§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§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.