ChainTextures

Struct ChainTextures 

Source
pub struct ChainTextures {
Show 24 fields pub render_texture: Texture, pub render_texture_view: TextureView, pub prev_texture: Texture, pub prev_texture_view: TextureView, pub final_texture: Texture, pub final_texture_view: TextureView, pub blur1_texture: Texture, pub blur1_texture_view: TextureView, pub blur1_scratch_texture: Texture, pub blur1_scratch_texture_view: TextureView, pub blur2_texture: Texture, pub blur2_texture_view: TextureView, pub blur2_scratch_texture: Texture, pub blur2_scratch_texture_view: TextureView, pub blur3_texture: Texture, pub blur3_texture_view: TextureView, pub blur3_scratch_texture: Texture, pub blur3_scratch_texture_view: TextureView, pub prev_blur1_texture: Texture, pub prev_blur1_texture_view: TextureView, pub prev_blur2_texture: Texture, pub prev_blur2_texture_view: TextureView, pub prev_blur3_texture: Texture, pub prev_blur3_texture_view: TextureView,
}
Expand description

All resolution-dependent textures consumed and produced by one rendering chain.

Fields§

§render_texture: Texture

Warp pass output. Fed back into next frame’s warp pass via Self::prev_texture, and read by the comp pass for the current frame’s display output. Display-only filters never write here so they don’t leak into the feedback loop.

§render_texture_view: TextureView§prev_texture: Texture

Last frame’s warp output. Sampled by the warp pass on the next frame’s feedback step. copy_to_prev swaps the current frame’s render_texture into this slot at the end of each render.

§prev_texture_view: TextureView§final_texture: Texture

Comp pass output for this chain. The user-visible image (after gamma + echo + anaglyph + user comp shader) — but not the display: secondary chains during transitions render here too, and the final-blend pipeline composites the chain’s final_texture into the renderer’s display target.

§final_texture_view: TextureView§blur1_texture: Texture§blur1_texture_view: TextureView§blur1_scratch_texture: Texture§blur1_scratch_texture_view: TextureView§blur2_texture: Texture§blur2_texture_view: TextureView§blur2_scratch_texture: Texture§blur2_scratch_texture_view: TextureView§blur3_texture: Texture§blur3_texture_view: TextureView§blur3_scratch_texture: Texture§blur3_scratch_texture_view: TextureView§prev_blur1_texture: Texture

One-frame-delayed copy of the blur pyramid. Populated at the end of each frame (after the blur pipeline writes the current frame’s pyramid); read by the next frame’s warp pass — where a user warp shader’s GetBlur1/2/3(uv) sample the previous frame’s blur, mirroring how prev_texture mirrors the previous warp output. Required because the warp pass runs before this frame’s blur pipeline; sampling this-frame’s blur would be a self-dependency.

§prev_blur1_texture_view: TextureView§prev_blur2_texture: Texture§prev_blur2_texture_view: TextureView§prev_blur3_texture: Texture§prev_blur3_texture_view: TextureView

Implementations§

Source§

impl ChainTextures

Source

pub fn new(device: &Device, config: &RenderConfig) -> Self

Allocate a fresh set of per-chain textures at the resolution + format declared by config. Initial contents are undefined; the first warp pass clears render_texture and the first copy_to_prev populates prev_texture.

Source

pub fn resize(&mut self, device: &Device, config: &RenderConfig)

Re-allocate every texture at the new resolution. All TextureViews become invalid after this call; downstream pipelines (warp, comp, blur, custom_shape) must be rebound — see [crate::render_chain::RenderChain::rebind_after_resize].

Source

pub fn copy_blur_to_prev( &self, encoder: &mut CommandEncoder, _config: &RenderConfig, )

Copy blur{1,2,3}_textureprev_blur{1,2,3}_texture so the next frame’s warp pass (which runs before that frame’s blur pipeline) can sample a one-frame-delayed pyramid through a user-translated warp shader’s GetBlur1/2/3(uv). Cheap — three GPU copy_texture_to_texture calls on already-resident memory. Must run AFTER the blur pipeline has written this frame’s blur1/2/3 (otherwise we’d snapshot stale data).

Source

pub fn copy_to_prev(&self, encoder: &mut CommandEncoder, config: &RenderConfig)

Copy render_textureprev_texture to close the feedback loop for next frame. Must run AFTER the comp pass for the current frame has consumed prev_texture (the echo blend reads frame N-1’s warp output via prev_texture).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,