pub enum SystemStage {
Startup,
PreUpdate,
Update,
PostUpdate,
PreRender,
AssetSync,
AssetSyncDeps,
Render,
PostRender,
}Expand description
Determines when during a frame a system is executed.
Startup systems each run at most once — but not
necessarily during App::build: a system whose hard Res/ResMut
requirements aren’t satisfied yet is skipped (never panicked) and retried
every tick, prioritized ahead of PreUpdate
and everything after it, until it fires exactly once. This lets a
Startup system depend on something that only becomes real several
frames in — a LazyResource built from an async GPU backend, for
example — without moving it off Startup.
AssetSync/AssetSyncDeps
are similarly prioritized: they (and any newly-ready Startup systems)
are re-run to convergence at the front of every tick and again after
every other stage, so newly queued asset/resource work is drained before
gameplay stages continue rather than waiting for the next tick’s front
pass. All other stages run once per App::update tick, in the order
declared below.
Variants§
Startup
Each system runs at most once, as soon as its requirements are met —
possibly during App::build, possibly several ticks into
App::update. See the type-level docs above.
PreUpdate
Before the main update.
Update
Main game-logic update.
PostUpdate
After the main update.
PreRender
Prepare rendering data and poll for the GPU backend. The backend resource becomes available here on the tick it finishes initialising, making it visible to the asset sync stages.
AssetSync
Upload CPU-side source assets to the GPU backend.
AssetSyncDeps
Construct lazy GPU resources and upload assets that depend on other processed assets. Runs in a convergence loop so dependency chains (e.g. LazyResource A → LazyResource B) resolve within a single tick.
Render
Issue draw calls.
PostRender
Cleanup or post-processing after rendering.
Implementations§
Source§impl SystemStage
impl SystemStage
Sourcepub fn is_convergent(self) -> bool
pub fn is_convergent(self) -> bool
Returns true for stages that are prioritized and re-run until a
full pass produces no new resources, instead of running once in
their declared position in the tick order. See the type-level docs
on SystemStage.
Trait Implementations§
Source§impl Clone for SystemStage
impl Clone for SystemStage
Source§fn clone(&self) -> SystemStage
fn clone(&self) -> SystemStage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SystemStage
Source§impl Debug for SystemStage
impl Debug for SystemStage
impl Eq for SystemStage
Source§impl Hash for SystemStage
impl Hash for SystemStage
Source§impl Ord for SystemStage
impl Ord for SystemStage
Source§fn cmp(&self, other: &SystemStage) -> Ordering
fn cmp(&self, other: &SystemStage) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SystemStage
impl PartialEq for SystemStage
Source§impl PartialOrd for SystemStage
impl PartialOrd for SystemStage
impl StructuralPartialEq for SystemStage
Auto Trait Implementations§
impl Freeze for SystemStage
impl RefUnwindSafe for SystemStage
impl Send for SystemStage
impl Sync for SystemStage
impl Unpin for SystemStage
impl UnsafeUnpin for SystemStage
impl UnwindSafe for SystemStage
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
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> Component for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.