pub struct MeshPipeline {
pub view_layouts: MeshPipelineViewLayouts,
pub clustered_forward_buffer_binding_type: BufferBindingType,
pub mesh_layouts: MeshLayouts,
pub shader: Handle<Shader>,
pub per_object_buffer_batch_size: Option<u32>,
pub binding_arrays_are_usable: bool,
pub clustered_decals_are_usable: bool,
pub skins_use_uniform_buffers: bool,
pub metadata_use_uniform_buffers: bool,
}Expand description
All data needed to construct a pipeline for rendering 3D meshes.
Fields§
§view_layouts: MeshPipelineViewLayoutsA reference to all the mesh pipeline view layouts.
clustered_forward_buffer_binding_type: BufferBindingType§mesh_layouts: MeshLayouts§shader: Handle<Shader>The shader asset handle.
per_object_buffer_batch_size: Option<u32>MeshUniforms are stored in arrays in buffers. If storage buffers are available, they
are used and this will be None, otherwise uniform buffers will be used with batches
of this many MeshUniforms, stored at dynamic offsets within the uniform buffer.
Use code like this in custom shaders:
@if(PER_OBJECT_BUFFER_BATCH_SIZE)
@group(1) @binding(0) var<uniform> mesh: array<Mesh, u32(constants::PER_OBJECT_BUFFER_BATCH_SIZE)>;
@else
@group(1) @binding(0) var<storage> mesh: array<Mesh>;binding_arrays_are_usable: boolWhether binding arrays (a.k.a. bindless textures) are usable on the current render device.
This affects whether reflection probes can be used.
clustered_decals_are_usable: boolWhether clustered decals are usable on the current render device.
skins_use_uniform_buffers: boolWhether skins will use uniform buffers on account of storage buffers being unavailable on this platform.
metadata_use_uniform_buffers: boolWhether mesh metadata will use uniform buffers on account of storage buffers being unavailable on this platform.
Implementations§
Source§impl MeshPipeline
impl MeshPipeline
pub fn get_view_layout( &self, layout_key: MeshPipelineViewLayoutKey, ) -> MeshPipelineViewLayout
Trait Implementations§
Source§impl Clone for MeshPipeline
impl Clone for MeshPipeline
Source§fn clone(&self) -> MeshPipeline
fn clone(&self) -> MeshPipeline
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for MeshPipeline
impl Component for MeshPipeline
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::SparseSet
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::SparseSet
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<MeshPipeline>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<MeshPipeline>>
ComponentRelationshipAccessor required for working with relationships in dynamic contexts. Read moreSource§fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreSource§const HAS_SUMMARY_TICK: bool = false
const HAS_SUMMARY_TICK: bool = false
Source§impl GetBatchData for MeshPipeline
impl GetBatchData for MeshPipeline
Source§type Param = (Res<'static, RenderMeshInstances>, Res<'static, RenderLightmaps>, Res<'static, MeshAllocator>, Res<'static, SkinUniforms>, Res<'static, MorphIndices>)
type Param = (Res<'static, RenderMeshInstances>, Res<'static, RenderLightmaps>, Res<'static, MeshAllocator>, Res<'static, SkinUniforms>, Res<'static, MorphIndices>)
GetBatchData::get_batch_data needs in
order to compute the batch data.Source§type BatchSetCompareData = MeshBatchSetCompareData
type BatchSetCompareData = MeshBatchSetCompareData
Source§type BatchCompareData = AssetId<Mesh>
type BatchCompareData = AssetId<Mesh>
Source§type BufferData = MeshUniform
type BufferData = MeshUniform
crate::render_resource::GpuArrayBuffer containing these data for all
instances.Source§fn get_batch_data(
_: &<<MeshPipeline as GetBatchData>::Param as SystemParam>::Item<'_, '_>,
_: (Entity, MainEntity),
) -> Option<(<MeshPipeline as GetBatchData>::BufferData, Option<(<MeshPipeline as GetBatchData>::BatchSetCompareData, <MeshPipeline as GetBatchData>::BatchCompareData)>)>
fn get_batch_data( _: &<<MeshPipeline as GetBatchData>::Param as SystemParam>::Item<'_, '_>, _: (Entity, MainEntity), ) -> Option<(<MeshPipeline as GetBatchData>::BufferData, Option<(<MeshPipeline as GetBatchData>::BatchSetCompareData, <MeshPipeline as GetBatchData>::BatchCompareData)>)>
crate::render_resource::GpuArrayBuffer. If the instance can be
batched, also return the data used for comparison when deciding whether
draws can be batched, else return None for the CompareData. Read moreSource§impl GetFullBatchData for MeshPipeline
impl GetFullBatchData for MeshPipeline
Source§type BufferInputData = MeshInputUniform
type BufferInputData = MeshInputUniform
crate::render_resource::BufferVec during extraction.Source§fn get_index_and_compare_data(
_: &<<MeshPipeline as GetBatchData>::Param as SystemParam>::Item<'_, '_>,
main_entity: MainEntity,
) -> Option<(NonMaxU32, Option<(<MeshPipeline as GetBatchData>::BatchSetCompareData, <MeshPipeline as GetBatchData>::BatchCompareData)>)>
fn get_index_and_compare_data( _: &<<MeshPipeline as GetBatchData>::Param as SystemParam>::Item<'_, '_>, main_entity: MainEntity, ) -> Option<(NonMaxU32, Option<(<MeshPipeline as GetBatchData>::BatchSetCompareData, <MeshPipeline as GetBatchData>::BatchCompareData)>)>
GetFullBatchData::BufferInputData that the
GPU preprocessing phase will use. Read moreSource§fn get_binned_batch_data(
_: &<<MeshPipeline as GetBatchData>::Param as SystemParam>::Item<'_, '_>,
main_entity: MainEntity,
) -> Option<<MeshPipeline as GetBatchData>::BufferData>
fn get_binned_batch_data( _: &<<MeshPipeline as GetBatchData>::Param as SystemParam>::Item<'_, '_>, main_entity: MainEntity, ) -> Option<<MeshPipeline as GetBatchData>::BufferData>
crate::render_resource::GpuArrayBuffer. Read moreSource§fn get_binned_index(
_: &<<MeshPipeline as GetBatchData>::Param as SystemParam>::Item<'_, '_>,
main_entity: MainEntity,
) -> Option<NonMaxU32>
fn get_binned_index( _: &<<MeshPipeline as GetBatchData>::Param as SystemParam>::Item<'_, '_>, main_entity: MainEntity, ) -> Option<NonMaxU32>
GetFullBatchData::BufferInputData that the
GPU preprocessing phase will use. Read moreSource§fn write_batch_indirect_parameters_metadata(
indexed: bool,
base_output_index: u32,
batch_set_index: Option<NonMaxU32>,
phase_indirect_parameters_buffers: &mut UntypedPhaseIndirectParametersBuffers,
indirect_parameters_offset: u32,
)
fn write_batch_indirect_parameters_metadata( indexed: bool, base_output_index: u32, batch_set_index: Option<NonMaxU32>, phase_indirect_parameters_buffers: &mut UntypedPhaseIndirectParametersBuffers, indirect_parameters_offset: u32, )
gpu_preprocessing::IndirectParametersMetadata necessary
to draw this batch into the given metadata buffer at the given index. Read moreSource§impl SpecializedMeshPipeline for MeshPipeline
impl SpecializedMeshPipeline for MeshPipeline
Source§type Key = MeshPipelineKey
type Key = MeshPipelineKey
Source§fn specialize(
&self,
key: <MeshPipeline as SpecializedMeshPipeline>::Key,
layout: &MeshVertexBufferLayoutRef,
) -> Result<RenderPipelineDescriptor, SpecializedMeshPipelineError>
fn specialize( &self, key: <MeshPipeline as SpecializedMeshPipeline>::Key, layout: &MeshVertexBufferLayoutRef, ) -> Result<RenderPipelineDescriptor, SpecializedMeshPipelineError>
impl Resource for MeshPipeline
Auto Trait Implementations§
impl Freeze for MeshPipeline
impl RefUnwindSafe for MeshPipeline
impl Send for MeshPipeline
impl Sync for MeshPipeline
impl !Unpin for MeshPipeline
impl UnsafeUnpin for MeshPipeline
impl UnwindSafe for MeshPipeline
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.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
Source§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
Source§fn get_component_ids(
components: &Components,
) -> impl Iterator<Item = Option<ComponentId>>
fn get_component_ids( components: &Components, ) -> impl Iterator<Item = Option<ComponentId>>
Source§impl<C> BundleFromComponents for Cwhere
C: Component,
impl<C> BundleFromComponents for Cwhere
C: Component,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
Source§unsafe fn get_components(
ptr: MovingPtr<'_, C>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
) -> <C as DynamicBundle>::Effect
unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
Source§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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 moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
self.