pub struct DepthComposite { /* private fields */ }Expand description
Viewport-owned offscreen scene target + depth buffer + blit pipeline.
Created through DepthComposite::ensure (per viewport id), drawn into
with DepthComposite::begin_scene, composited back with
DepthComposite::blit. Textures recreate on format/sample/size
change; buffer contents are per-frame and never retained.
Implementations§
Source§impl DepthComposite
impl DepthComposite
Sourcepub fn get(resources: &mut CallbackResources) -> &mut Self
pub fn get(resources: &mut CallbackResources) -> &mut Self
Fetch the composite store from callback resources (creating it on first use). One store per render pass; ids disambiguate viewports.
Sourcepub fn ensure(
&mut self,
device: &Device,
screen: &ScreenDescriptor,
id: &str,
w: u32,
h: u32,
)
pub fn ensure( &mut self, device: &Device, screen: &ScreenDescriptor, id: &str, w: u32, h: u32, )
Ensure the offscreen target for id at wxh (recreates on
format/sample/size change, like every other viewport-owned target).
Dimensions clamp to >= 1.
Sourcepub fn begin_scene<'a>(
&'a self,
id: &str,
encoder: &'a mut CommandEncoder,
clear: [f32; 4],
) -> Option<RenderPass<'a>>
pub fn begin_scene<'a>( &'a self, id: &str, encoder: &'a mut CommandEncoder, clear: [f32; 4], ) -> Option<RenderPass<'a>>
Sourcepub fn depth_format(&self, id: &str) -> Option<TextureFormat>
pub fn depth_format(&self, id: &str) -> Option<TextureFormat>
Depth format backing the scene target (for caller pipelines).
Sourcepub fn blit(&self, id: &str, rpass: &mut RenderPass<'_>)
pub fn blit(&self, id: &str, rpass: &mut RenderPass<'_>)
Composite the offscreen scene for id into the main pass. The
renderer has already set the viewport to the callback rect, which
matches the offscreen texture 1:1 (both come from the painted frame
geometry). No-op when id has no target.
Trait Implementations§
Source§impl Default for DepthComposite
impl Default for DepthComposite
Source§fn default() -> DepthComposite
fn default() -> DepthComposite
Auto Trait Implementations§
impl !RefUnwindSafe for DepthComposite
impl !UnwindSafe for DepthComposite
impl Freeze for DepthComposite
impl Send for DepthComposite
impl Sync for DepthComposite
impl Unpin for DepthComposite
impl UnsafeUnpin for DepthComposite
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.