Enum wgpu::ShaderSource
source · #[non_exhaustive]pub enum ShaderSource<'a> {
Wgsl(Cow<'a, str>),
Naga(Cow<'static, Module>),
}
Expand description
Source of a shader module.
The source will be parsed and validated.
Any necessary shader translation (e.g. from WGSL to SPIR-V or vice versa) will be done internally by wgpu.
This type is unique to the Rust API of wgpu
. In the WebGPU specification,
only WGSL source code strings are accepted.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Trait Implementations§
source§impl<'a> Clone for ShaderSource<'a>
impl<'a> Clone for ShaderSource<'a>
source§fn clone(&self) -> ShaderSource<'a>
fn clone(&self) -> ShaderSource<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for ShaderSource<'a>
impl<'a> RefUnwindSafe for ShaderSource<'a>
impl<'a> Send for ShaderSource<'a>
impl<'a> Sync for ShaderSource<'a>
impl<'a> Unpin for ShaderSource<'a>
impl<'a> UnwindSafe for ShaderSource<'a>
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