pub struct HotReloadRegistry {
pub watcher: ShaderWatcher,
pub invalidated_pipelines: HashSet<String>,
pub reload_count: u64,
/* private fields */
}Expand description
Maps render pipeline IDs to the shader labels they depend on and automatically marks pipelines as invalidated when their shaders change.
Fields§
§watcher: ShaderWatcher§invalidated_pipelines: HashSet<String>Set of pipeline IDs that need to be rebuilt.
reload_count: u64Total number of successful reloads processed.
Implementations§
Source§impl HotReloadRegistry
impl HotReloadRegistry
Sourcepub fn register_pipeline(
&mut self,
pipeline_id: impl Into<String>,
shader_label: &str,
)
pub fn register_pipeline( &mut self, pipeline_id: impl Into<String>, shader_label: &str, )
Register a pipeline as depending on a shader label.
A pipeline may depend on multiple shaders; call this method once per shader dependency.
Sourcepub fn process_changes(&mut self) -> Vec<String>
pub fn process_changes(&mut self) -> Vec<String>
Poll for shader changes and mark dependent pipelines as invalidated.
Returns the list of pipeline IDs that have been newly invalidated.
Sourcepub fn is_invalidated(&self, pipeline_id: &str) -> bool
pub fn is_invalidated(&self, pipeline_id: &str) -> bool
Returns true if the pipeline is currently marked as invalidated.
Sourcepub fn clear_invalidated(&mut self, pipeline_id: &str)
pub fn clear_invalidated(&mut self, pipeline_id: &str)
Clear the invalidation flag for a pipeline after it has been rebuilt.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HotReloadRegistry
impl RefUnwindSafe for HotReloadRegistry
impl Send for HotReloadRegistry
impl Sync for HotReloadRegistry
impl Unpin for HotReloadRegistry
impl UnsafeUnpin for HotReloadRegistry
impl UnwindSafe for HotReloadRegistry
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