Skip to main content

OffscreenTarget

Struct OffscreenTarget 

Source
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: TextureUsages

Implementations§

Source§

impl OffscreenTarget

Source

pub fn default_color_usages(format: TextureFormat) -> TextureUsages

Returns the default color texture usages for a given format.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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 OffscreenTarget
where *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
where Arc<CoreTexture>: Send, &'static str: Send, InternalBitFlags: Send, &'static [TextureFormat]: Send, Arc<CoreTextureView>: Send,

§

impl Sync for OffscreenTarget
where Arc<CoreTexture>: Sync, InternalBitFlags: Sync, Arc<CoreTextureView>: Sync,

§

impl Unpin for OffscreenTarget
where Arc<CoreTexture>: Unpin, &'static str: Unpin, InternalBitFlags: Unpin, &'static [TextureFormat]: Unpin, Arc<CoreTextureView>: Unpin,

§

impl UnsafeUnpin for OffscreenTarget
where *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> 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
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<T> Upcast<T> for T

Source§

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

Source§

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

Source§

impl<T> WasmNotSendSync for T

Source§

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