pub enum RendererLoadingPhase {
Init,
CompilingShaders,
BuildingPipelines,
Ready,
}Expand description
Coarse-grained stages the renderer passes through during
AwsmRendererBuilder::build. Subscribers passed via
AwsmRendererBuilder::with_phase_handler get a callback at each
transition; consumer UIs can map these to whatever progress
message they want to show.
The most useful UX win these surface is the cold WebGPU cache
case: a fresh Chrome profile can sit on CompilingShaders for
tens of seconds while Dawn + the GPU driver lower every shader to
MSL on the first visit. Showing “Browser is compiling shaders…
(first load may take a while)” rather than a frozen “Initializing
renderer…” is the difference between a user assuming the app is
broken and a user knowing the browser is doing real work that
will be cached next time.
Variants§
Init
Adapter / device acquisition + initial bookkeeping + supporting GPU resource generation (IBL default cubemaps, BRDF LUT compute, opaque-mipgen pipeline) + render-pass shader cache key collection. No Dawn shader / pipeline compile work in this phase — it’s the concurrent setup that feeds the cross-renderer pool.
CompilingShaders
The cross-renderer shader pool is running:
one Shaders::ensure_keys covering every shader the
renderer compiles (RenderPasses + Picker + LineRenderer +
Shadows caster + Effects + Display), joined with EVSM
inline-shader validate_shader futures. On a cold PSO disk
cache this is where Dawn lowers WGSL → MSL; on a warm cache
it’s a cache-hit lookup.
BuildingPipelines
The cross-renderer pipeline pool is running: one
try_join’d ComputePipelines::ensure_keys +
RenderPipelines::ensure_keys covering every compute and
render pipeline across the entire renderer.
Ready
All renderer-init work done; ready to render.
Trait Implementations§
Source§impl Clone for RendererLoadingPhase
impl Clone for RendererLoadingPhase
Source§fn clone(&self) -> RendererLoadingPhase
fn clone(&self) -> RendererLoadingPhase
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 RendererLoadingPhase
Source§impl Debug for RendererLoadingPhase
impl Debug for RendererLoadingPhase
impl Eq for RendererLoadingPhase
Source§impl Hash for RendererLoadingPhase
impl Hash for RendererLoadingPhase
Source§impl PartialEq for RendererLoadingPhase
impl PartialEq for RendererLoadingPhase
Source§fn eq(&self, other: &RendererLoadingPhase) -> bool
fn eq(&self, other: &RendererLoadingPhase) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RendererLoadingPhase
Auto Trait Implementations§
impl Freeze for RendererLoadingPhase
impl RefUnwindSafe for RendererLoadingPhase
impl Send for RendererLoadingPhase
impl Sync for RendererLoadingPhase
impl Unpin for RendererLoadingPhase
impl UnsafeUnpin for RendererLoadingPhase
impl UnwindSafe for RendererLoadingPhase
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.