pub struct WgslShader { /* private fields */ }Expand description
WGSL shader wrapper with validation and compilation.
Implementations§
Source§impl WgslShader
impl WgslShader
Sourcepub fn new(source: impl Into<String>, entry_point: impl Into<String>) -> Self
pub fn new(source: impl Into<String>, entry_point: impl Into<String>) -> Self
Create a new WGSL shader from source.
Sourcepub fn compile(&mut self, device: &Device) -> GpuResult<&ShaderModule>
pub fn compile(&mut self, device: &Device) -> GpuResult<&ShaderModule>
Sourcepub fn entry_point(&self) -> &str
pub fn entry_point(&self) -> &str
Get the shader entry point.
Auto Trait Implementations§
impl Freeze for WgslShader
impl !RefUnwindSafe for WgslShader
impl Send for WgslShader
impl Sync for WgslShader
impl Unpin for WgslShader
impl UnsafeUnpin for WgslShader
impl !UnwindSafe for WgslShader
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