pub struct ShaderRegistry { /* private fields */ }Expand description
A registry of named compute shader descriptors.
Implementations§
Source§impl ShaderRegistry
impl ShaderRegistry
Sourcepub fn register(&mut self, name: impl Into<String>, desc: ComputeShaderDesc)
pub fn register(&mut self, name: impl Into<String>, desc: ComputeShaderDesc)
Register a shader under the given name.
Sourcepub fn get(&self, name: &str) -> Option<&ComputeShaderDesc>
pub fn get(&self, name: &str) -> Option<&ComputeShaderDesc>
Retrieve a shader descriptor by name.
Sourcepub fn names(&self) -> impl Iterator<Item = &str>
pub fn names(&self) -> impl Iterator<Item = &str>
Return an iterator over registered shader names.
Sourcepub fn unregister(&mut self, name: &str) -> Option<ComputeShaderDesc>
pub fn unregister(&mut self, name: &str) -> Option<ComputeShaderDesc>
Remove a shader from the registry.
Sourcepub fn with_builtins() -> Self
pub fn with_builtins() -> Self
Create a registry pre-populated with the built-in shaders.
Trait Implementations§
Source§impl Debug for ShaderRegistry
impl Debug for ShaderRegistry
Source§impl Default for ShaderRegistry
impl Default for ShaderRegistry
Source§fn default() -> ShaderRegistry
fn default() -> ShaderRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ShaderRegistry
impl RefUnwindSafe for ShaderRegistry
impl Send for ShaderRegistry
impl Sync for ShaderRegistry
impl Unpin for ShaderRegistry
impl UnsafeUnpin for ShaderRegistry
impl UnwindSafe for ShaderRegistry
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