pub struct OffscreenTarget {
pub dimensions: TargetDimensions,
pub color_texture: Texture,
pub color_view: TextureView,
pub color_format: TextureFormat,
pub color_usage: TextureUsages,
pub depth_texture: Option<Texture>,
pub depth_view: Option<TextureView>,
pub depth_format: Option<TextureFormat>,
pub depth_usage: TextureUsages,
}Expand description
An offscreen render target owning a color texture and an optional depth texture.
Fields§
§dimensions: TargetDimensions§color_texture: Texture§color_view: TextureView§color_format: TextureFormat§color_usage: TextureUsages§depth_texture: Option<Texture>§depth_view: Option<TextureView>§depth_format: Option<TextureFormat>§depth_usage: TextureUsagesImplementations§
Source§impl OffscreenTarget
impl OffscreenTarget
Sourcepub fn default_color_usages(format: TextureFormat) -> TextureUsages
pub fn default_color_usages(format: TextureFormat) -> TextureUsages
Returns the default color texture usages for a given format.
Sourcepub fn new(
device: &Device,
dimensions: TargetDimensions,
color_format: TextureFormat,
depth_format: Option<TextureFormat>,
) -> Self
pub fn new( device: &Device, dimensions: TargetDimensions, color_format: TextureFormat, depth_format: Option<TextureFormat>, ) -> Self
Creates a new offscreen render target with default usages for color_format.
Sourcepub fn new_with_usage(
device: &Device,
dimensions: TargetDimensions,
color_format: TextureFormat,
depth_format: Option<TextureFormat>,
color_usage: TextureUsages,
) -> Self
pub fn new_with_usage( device: &Device, dimensions: TargetDimensions, color_format: TextureFormat, depth_format: Option<TextureFormat>, color_usage: TextureUsages, ) -> Self
Creates a new offscreen render target with an explicit color texture usage mask.
Sourcepub fn new_storage_compatible(
device: &Device,
dimensions: TargetDimensions,
color_format: TextureFormat,
depth_format: Option<TextureFormat>,
) -> Self
pub fn new_storage_compatible( device: &Device, dimensions: TargetDimensions, color_format: TextureFormat, depth_format: Option<TextureFormat>, ) -> Self
Creates a new offscreen render target with STORAGE_BINDING enabled on the color texture.
Sourcepub fn new_with_options(
device: &Device,
dimensions: TargetDimensions,
color_format: TextureFormat,
depth_format: Option<TextureFormat>,
options: OffscreenTargetOptions,
) -> Self
pub fn new_with_options( device: &Device, dimensions: TargetDimensions, color_format: TextureFormat, depth_format: Option<TextureFormat>, options: OffscreenTargetOptions, ) -> Self
Creates a new offscreen render target with full OffscreenTargetOptions.
Sourcepub fn ensure_dimensions(
&mut self,
device: &Device,
dimensions: TargetDimensions,
) -> bool
pub fn ensure_dimensions( &mut self, device: &Device, dimensions: TargetDimensions, ) -> bool
Recreates the underlying textures only when physical pixel dimensions change,
preserving the target’s formats and usage flags. Returns true if reallocated.
Auto Trait Implementations§
impl !RefUnwindSafe for OffscreenTarget
impl !UnwindSafe for OffscreenTarget
impl Forget for OffscreenTarget
impl Freeze for OffscreenTargetwhere
*const ArcInner<CoreTexture> is !null: Freeze,
PhantomData<ArcInner<CoreTexture>>: Freeze,
&'static str: Freeze,
InternalBitFlags: Freeze,
&'static [TextureFormat]: Freeze,
*const ArcInner<CoreTextureView> is !null: Freeze,
PhantomData<ArcInner<CoreTextureView>>: Freeze,
impl Move for OffscreenTarget
impl Send for OffscreenTarget
impl Sync for OffscreenTarget
impl Unpin for OffscreenTarget
impl UnsafeUnpin for OffscreenTargetwhere
*const ArcInner<CoreTexture> is !null: UnsafeUnpin,
PhantomData<ArcInner<CoreTexture>>: UnsafeUnpin,
&'static str: UnsafeUnpin,
InternalBitFlags: UnsafeUnpin,
&'static [TextureFormat]: UnsafeUnpin,
*const ArcInner<CoreTextureView> is !null: UnsafeUnpin,
PhantomData<ArcInner<CoreTextureView>>: UnsafeUnpin,
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