pub struct FinalBlendPipeline {
pipeline: RenderPipeline,
bind_group_layout: BindGroupLayout,
sampler: Sampler,
uniform_buffer: Buffer,
bind_group: BindGroup,
fallback_view: TextureView,
display_texture: Texture,
display_texture_view: TextureView,
}Expand description
Owns the blend pipeline, its bind group, the per-frame uniform buffer, and the display target it writes into. Created once at renderer init and never reallocated; only the bind group is rebuilt when a secondary chain is added or removed.
Fields§
§pipeline: RenderPipeline§bind_group_layout: BindGroupLayout§sampler: Sampler§uniform_buffer: Buffer§bind_group: BindGroup§fallback_view: TextureView1×1 fallback bound into the secondary slot when no secondary chain
is active. The shader skips it via has_secondary == 0 but wgpu
still requires a valid view at every binding.
display_texture: TextureDisplay target this pass writes into. The renderer exposes it via
render_texture() so existing callers see the post-blend image.
display_texture_view: TextureViewImplementations§
Source§impl FinalBlendPipeline
impl FinalBlendPipeline
Sourcepub fn new(
device: &Arc<Device>,
config: &RenderConfig,
primary_view: &TextureView,
) -> Result<Self>
pub fn new( device: &Arc<Device>, config: &RenderConfig, primary_view: &TextureView, ) -> Result<Self>
Build the blend pipeline. primary_view is the initial primary
chain’s final_texture_view; the bind group is configured for
passthrough (secondary = fallback, progress = 0) at construction.
Sourcepub fn display_texture_view(&self) -> &TextureView
pub fn display_texture_view(&self) -> &TextureView
The final display texture written by record_pass. Callers expose
it as the renderer’s “presentable” output.
Borrow the display texture view — needed by overlay passes
(text, future HUD) that draw on top of the blended output.
pub fn display_texture(&self) -> &Texture
Sourcepub fn set_inputs(
&mut self,
device: &Arc<Device>,
primary_view: &TextureView,
secondary_view: Option<&TextureView>,
)
pub fn set_inputs( &mut self, device: &Arc<Device>, primary_view: &TextureView, secondary_view: Option<&TextureView>, )
Refresh the bind group with the current primary chain’s
final_texture_view and, optionally, a secondary chain’s view. Call
this whenever either chain’s textures get re-allocated (resize,
transition start/end).
Sourcepub fn update_progress(&self, queue: &Queue, progress: f32, has_secondary: bool)
pub fn update_progress(&self, queue: &Queue, progress: f32, has_secondary: bool)
Update the eased progress (0 = full secondary, 1 = full primary)
and the has_secondary flag in one upload.
Sourcepub fn resize(&mut self, device: &Arc<Device>, config: &RenderConfig)
pub fn resize(&mut self, device: &Arc<Device>, config: &RenderConfig)
Rebuild the display target at a new resolution. Must be followed by
a set_inputs call to rebind the (also-resized) primary view.
Sourcepub fn record_pass(&self, encoder: &mut CommandEncoder)
pub fn record_pass(&self, encoder: &mut CommandEncoder)
Record the blend pass into the supplied encoder. Output goes to the display texture; caller is responsible for the submit.
Auto Trait Implementations§
impl Freeze for FinalBlendPipeline
impl !RefUnwindSafe for FinalBlendPipeline
impl Send for FinalBlendPipeline
impl Sync for FinalBlendPipeline
impl Unpin for FinalBlendPipeline
impl !UnwindSafe for FinalBlendPipeline
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
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>
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>
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