pub struct ShaderPass<S: SequoiShader> { /* private fields */ }Expand description
A configured shader draw that can be handed to a canvas or reused.
Inputs are optional: Painter samples transparent white for textures the
pass does not bind. Self::primary_input binds the shader’s first
declared texture, which is what most single-input effects need.
Implementations§
Source§impl<S: SequoiShader> ShaderPass<S>
impl<S: SequoiShader> ShaderPass<S>
pub fn new(shader: S) -> Self
Sourcepub fn input(self, name: &'static str, input: TexInput) -> Self
pub fn input(self, name: &'static str, input: TexInput) -> Self
Binds input to the shader texture parameter name.
Sourcepub fn primary_input(self, input: TexInput) -> Self
pub fn primary_input(self, input: TexInput) -> Self
Binds the first texture declared by the shader, unless already bound.
This removes the need to repeat the parameter name at every call site.
Sourcepub fn layers(self, first: TexInput, second: TexInput) -> Self
pub fn layers(self, first: TexInput, second: TexInput) -> Self
Binds the first two declared textures in order.
pub fn name(&self) -> &'static str
pub fn target_rect(&self) -> Option<Rect>
Trait Implementations§
Source§impl<S: Clone + SequoiShader> Clone for ShaderPass<S>
impl<S: Clone + SequoiShader> Clone for ShaderPass<S>
Auto Trait Implementations§
impl<S> Freeze for ShaderPass<S>where
S: Freeze,
impl<S> RefUnwindSafe for ShaderPass<S>where
S: RefUnwindSafe,
impl<S> Send for ShaderPass<S>where
S: Send,
impl<S> Sync for ShaderPass<S>where
S: Sync,
impl<S> Unpin for ShaderPass<S>where
S: Unpin,
impl<S> UnsafeUnpin for ShaderPass<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for ShaderPass<S>where
S: UnwindSafe,
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