pub struct PerPixelPipeline {
device: Device,
queue: Queue,
render_pipeline: Option<RenderPipeline>,
bind_group_layout: BindGroupLayout,
bind_group: Option<BindGroup>,
vars_buffer: Buffer,
vars: PixelVarsUniform,
input_texture: Option<Texture>,
output_texture: Option<Texture>,
sampler: Sampler,
width: u32,
height: u32,
}Expand description
Per-pixel rendering pipeline
Fields§
§device: Device§queue: Queue§render_pipeline: Option<RenderPipeline>§bind_group_layout: BindGroupLayout§bind_group: Option<BindGroup>§vars_buffer: Buffer§vars: PixelVarsUniform§input_texture: Option<Texture>§output_texture: Option<Texture>§sampler: Sampler§width: u32§height: u32Implementations§
Source§impl PerPixelPipeline
impl PerPixelPipeline
pub fn new( device: Device, queue: Queue, width: u32, height: u32, ) -> Result<Self>
Sourcepub fn set_shader(&mut self, shader_module: &ShaderModule) -> Result<()>
pub fn set_shader(&mut self, shader_module: &ShaderModule) -> Result<()>
Set the shader module from compiled WGSL
Sourcepub fn update_vars(&mut self, vars: PixelVarsUniform)
pub fn update_vars(&mut self, vars: PixelVarsUniform)
Update uniform variables
Sourcepub fn set_input_texture(&mut self, texture: Texture)
pub fn set_input_texture(&mut self, texture: Texture)
Set input texture
Sourcefn update_bind_group(&mut self)
fn update_bind_group(&mut self)
Update bind group with current textures
Auto Trait Implementations§
impl Freeze for PerPixelPipeline
impl !RefUnwindSafe for PerPixelPipeline
impl Send for PerPixelPipeline
impl Sync for PerPixelPipeline
impl Unpin for PerPixelPipeline
impl !UnwindSafe for PerPixelPipeline
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