pub struct DirtySpecializations {
pub changed_renderables: HashSet<MainEntity, EntityHash>,
pub removed_renderables: HashSet<MainEntity, EntityHash>,
pub views: HashSet<RetainedViewEntity>,
}Expand description
Stores information about all entities that have changed in such a way as to potentially require their pipelines to be re-specialized.
This is conservative; there’s no harm, other than performance, in having an entity in this list that doesn’t actually need to be re-specialized. Note that the presence of an entity in this list doesn’t mean that a new shader will necessarily be compiled; the pipeline cache is checked first.
This handles 2D meshes, 3D meshes, and sprites. For 2D and 3D wireframes,
see DirtyWireframeSpecializations. The reason for having two separate
lists is that a single entity can have both a mesh and a wireframe.
Fields§
§changed_renderables: HashSet<MainEntity, EntityHash>All renderable objects that must be re-specialized this frame.
removed_renderables: HashSet<MainEntity, EntityHash>All renderable objects that need their specializations removed this frame.
Note that this may include entities in Self::changed_renderables.
This is fine, as old specializations are removed before new ones are
added.
views: HashSet<RetainedViewEntity>Views that must be respecialized this frame.
The presence of a view in this list causes all entities that it renders to be re-specialized.
Implementations§
Source§impl DirtySpecializations
impl DirtySpecializations
Sourcepub fn must_wipe_specializations_for_view(
&self,
view: RetainedViewEntity,
) -> bool
pub fn must_wipe_specializations_for_view( &self, view: RetainedViewEntity, ) -> bool
Returns true if the view has changed in such a way that all specialized pipelines for entities visible from it must be regenerated.
Sourcepub fn iter_to_despecialize<'a>(
&'a self,
) -> impl Iterator<Item = &'a MainEntity>
pub fn iter_to_despecialize<'a>( &'a self, ) -> impl Iterator<Item = &'a MainEntity>
Iterates over all entities that need their specializations cleared in this frame.
Sourcepub fn iter_to_specialize<'a>(
&'a self,
view: RetainedViewEntity,
render_view_visible_mesh_entities: &'a RenderVisibleEntitiesClass,
last_frame_view_pending_queues: &'a HashSet<(Entity, MainEntity)>,
) -> impl Iterator<Item = (&'a Entity, &'a MainEntity)>
pub fn iter_to_specialize<'a>( &'a self, view: RetainedViewEntity, render_view_visible_mesh_entities: &'a RenderVisibleEntitiesClass, last_frame_view_pending_queues: &'a HashSet<(Entity, MainEntity)>, ) -> impl Iterator<Item = (&'a Entity, &'a MainEntity)>
Iterates over all entities that need to have their pipelines re-specialized this frame.
last_frame_view_pending_queues should be the contents of the
ViewPendingQueues::prev_frame list.
Sourcepub fn iter_to_dequeue<'a>(
&'a self,
view: RetainedViewEntity,
render_visible_mesh_entities: &'a RenderVisibleEntitiesClass,
) -> impl Iterator<Item = &'a MainEntity>
pub fn iter_to_dequeue<'a>( &'a self, view: RetainedViewEntity, render_visible_mesh_entities: &'a RenderVisibleEntitiesClass, ) -> impl Iterator<Item = &'a MainEntity>
Iterates over all renderables that should be removed from the phase.
This includes renderables that became invisible this frame, renderables
that are in DirtySpecializations::changed_renderables, and
renderables that are in DirtySpecializations::removed_renderables.
If this view must itself be re-specialized, this will iterate over all
visible entities in addition to those that became invisible.
Sourcepub fn iter_to_queue<'a>(
&'a self,
view: RetainedViewEntity,
render_visible_mesh_entities: &'a RenderVisibleEntitiesClass,
last_frame_view_pending_queues: &'a HashSet<(Entity, MainEntity)>,
) -> impl Iterator<Item = (&'a Entity, &'a MainEntity)>
pub fn iter_to_queue<'a>( &'a self, view: RetainedViewEntity, render_visible_mesh_entities: &'a RenderVisibleEntitiesClass, last_frame_view_pending_queues: &'a HashSet<(Entity, MainEntity)>, ) -> impl Iterator<Item = (&'a Entity, &'a MainEntity)>
Iterates over all renderables that potentially need to be re-queued.
This includes both renderables that became visible and those that are in
DirtySpecializations::changed_renderables. If this view must itself
be re-specialized, this will iterate over all visible renderables.
last_frame_view_pending_queues should be the contents of the
ViewPendingQueues::prev_frame list.
Trait Implementations§
Source§impl Clone for DirtySpecializations
impl Clone for DirtySpecializations
Source§fn clone(&self) -> DirtySpecializations
fn clone(&self) -> DirtySpecializations
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 DirtySpecializations
impl Component for DirtySpecializations
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<DirtySpecializations>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<DirtySpecializations>>
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§impl Default for DirtySpecializations
impl Default for DirtySpecializations
Source§fn default() -> DirtySpecializations
fn default() -> DirtySpecializations
impl Resource for DirtySpecializations
Auto Trait Implementations§
impl Freeze for DirtySpecializations
impl RefUnwindSafe for DirtySpecializations
impl Send for DirtySpecializations
impl Sync for DirtySpecializations
impl Unpin for DirtySpecializations
impl UnsafeUnpin for DirtySpecializations
impl UnwindSafe for DirtySpecializations
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,
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
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> FromTemplate for T
impl<T> FromTemplate for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
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>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Settings for T
Source§impl<T> Template for T
impl<T> Template for T
Source§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.Source§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.