pub struct ShaderDependencyGraph { /* private fields */ }Expand description
Tracks which shaders depend on (include) which other shaders.
When a shader is modified, all shaders that depend on it (transitively) also need to be recompiled.
Implementations§
Source§impl ShaderDependencyGraph
impl ShaderDependencyGraph
Sourcepub fn add_dependency(
&mut self,
dependent: impl Into<String>,
dependency: impl Into<String>,
)
pub fn add_dependency( &mut self, dependent: impl Into<String>, dependency: impl Into<String>, )
Record that shader dependent depends on dependency.
Sourcepub fn direct_dependents(&self, dependency: &str) -> Vec<&str>
pub fn direct_dependents(&self, dependency: &str) -> Vec<&str>
Return all shaders that directly depend on dependency.
Sourcepub fn transitive_dependents(&self, changed_shader: &str) -> Vec<String>
pub fn transitive_dependents(&self, changed_shader: &str) -> Vec<String>
Return all shaders that transitively depend on changed_shader
(BFS / DFS over the dependency graph).
Sourcepub fn direct_dependencies(&self, shader: &str) -> &[String]
pub fn direct_dependencies(&self, shader: &str) -> &[String]
Return the direct dependencies of shader.
Sourcepub fn shaders_with_deps(&self) -> Vec<&str>
pub fn shaders_with_deps(&self) -> Vec<&str>
Return all shader names that have any recorded dependencies.
Trait Implementations§
Source§impl Debug for ShaderDependencyGraph
impl Debug for ShaderDependencyGraph
Source§impl Default for ShaderDependencyGraph
impl Default for ShaderDependencyGraph
Source§fn default() -> ShaderDependencyGraph
fn default() -> ShaderDependencyGraph
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ShaderDependencyGraph
impl RefUnwindSafe for ShaderDependencyGraph
impl Send for ShaderDependencyGraph
impl Sync for ShaderDependencyGraph
impl Unpin for ShaderDependencyGraph
impl UnsafeUnpin for ShaderDependencyGraph
impl UnwindSafe for ShaderDependencyGraph
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
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>
Converts
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>
Converts
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 more