pub struct SpirvShader { /* private fields */ }
Expand description
Spir-V shader.
Implementations§
Source§impl SpirvShader
impl SpirvShader
Sourcepub fn new(spirv: Vec<u32>, stage: ShaderStageFlags, entrypoint: &str) -> Self
pub fn new(spirv: Vec<u32>, stage: ShaderStageFlags, entrypoint: &str) -> Self
Create Spir-V shader from bytes.
Sourcepub fn from_bytes(
spirv: &[u8],
stage: ShaderStageFlags,
entrypoint: &str,
) -> Result<Self>
pub fn from_bytes( spirv: &[u8], stage: ShaderStageFlags, entrypoint: &str, ) -> Result<Self>
Create Spir-V shader from bytecode stored as bytes. Errors when passed byte array length is not a multiple of 4.
Trait Implementations§
Source§impl Clone for SpirvShader
impl Clone for SpirvShader
Source§fn clone(&self) -> SpirvShader
fn clone(&self) -> SpirvShader
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 moreSource§impl Debug for SpirvShader
impl Debug for SpirvShader
Source§impl Hash for SpirvShader
impl Hash for SpirvShader
Source§impl Ord for SpirvShader
impl Ord for SpirvShader
Source§fn cmp(&self, other: &SpirvShader) -> Ordering
fn cmp(&self, other: &SpirvShader) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SpirvShader
impl PartialEq for SpirvShader
Source§impl PartialOrd for SpirvShader
impl PartialOrd for SpirvShader
Source§impl Shader for SpirvShader
impl Shader for SpirvShader
Source§type Error = ShaderError
type Error = ShaderError
The error type returned by the spirv function of this shader.
Source§fn stage(&self) -> ShaderStageFlags
fn stage(&self) -> ShaderStageFlags
Get the rendy_core::hal representation of this shaders kind/stage.
Source§unsafe fn module<B>(
&self,
factory: &Factory<B>,
) -> Result<B::ShaderModule, ShaderError>where
B: Backend,
unsafe fn module<B>(
&self,
factory: &Factory<B>,
) -> Result<B::ShaderModule, ShaderError>where
B: Backend,
Create shader module. Read more
impl Eq for SpirvShader
impl StructuralPartialEq for SpirvShader
Auto Trait Implementations§
impl Freeze for SpirvShader
impl RefUnwindSafe for SpirvShader
impl Send for SpirvShader
impl Sync for SpirvShader
impl Unpin for SpirvShader
impl UnwindSafe for SpirvShader
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)