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: TextureWarp 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: TextureLast 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: TextureComp 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: TextureOne-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: TextureViewImplementations§
Source§impl ChainTextures
impl ChainTextures
Sourcepub fn new(device: &Device, config: &RenderConfig) -> Self
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.
Sourcepub fn resize(&mut self, device: &Device, config: &RenderConfig)
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].
Sourcepub fn copy_blur_to_prev(
&self,
encoder: &mut CommandEncoder,
_config: &RenderConfig,
)
pub fn copy_blur_to_prev( &self, encoder: &mut CommandEncoder, _config: &RenderConfig, )
Copy blur{1,2,3}_texture → prev_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).
Sourcepub fn copy_to_prev(&self, encoder: &mut CommandEncoder, config: &RenderConfig)
pub fn copy_to_prev(&self, encoder: &mut CommandEncoder, config: &RenderConfig)
Copy render_texture → prev_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§
impl Freeze for ChainTextures
impl !RefUnwindSafe for ChainTextures
impl Send for ChainTextures
impl Sync for ChainTextures
impl Unpin for ChainTextures
impl !UnwindSafe for ChainTextures
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