pub struct ShaderCompilationPipeline { /* private fields */ }Expand description
A pipeline for compiling WGSL shaders with preprocessing steps.
Steps: resolve includes -> apply specialization -> validate -> cache.
Implementations§
Source§impl ShaderCompilationPipeline
impl ShaderCompilationPipeline
Sourcepub fn add_include(&mut self, name: &str, source: &str)
pub fn add_include(&mut self, name: &str, source: &str)
Register an include file for #include resolution.
Sourcepub fn compile(
&mut self,
name: &str,
source: &str,
spec_map: Option<&SpecializationMap>,
) -> Result<String, String>
pub fn compile( &mut self, name: &str, source: &str, spec_map: Option<&SpecializationMap>, ) -> Result<String, String>
Compile a shader source through the pipeline.
Returns the processed source string. Caches the result.
Sourcepub fn cache_size(&self) -> usize
pub fn cache_size(&self) -> usize
Return the number of cached shaders.
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the compilation cache.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShaderCompilationPipeline
impl RefUnwindSafe for ShaderCompilationPipeline
impl Send for ShaderCompilationPipeline
impl Sync for ShaderCompilationPipeline
impl Unpin for ShaderCompilationPipeline
impl UnsafeUnpin for ShaderCompilationPipeline
impl UnwindSafe for ShaderCompilationPipeline
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