Skip to main content

Texture

Struct Texture 

Source
pub struct Texture { /* private fields */ }

Implementations§

Source§

impl Texture

Source

pub unsafe fn as_hal<A: Api>( self: Arc<Self>, ) -> Option<impl Deref<Target = A::Texture>>

§Safety
  • The raw texture handle must not be manually destroyed
Source§

impl Texture

Source

pub fn invalid(device: &Arc<Device>, desc: &TextureDescriptor<'_>) -> Arc<Self> ⓘ

Source

pub fn texture_binding_view_dimension(&self) -> Option<TextureViewDimension>

Return the resolved texture binding view dimension.

Source§

impl Texture

Source

pub fn check_valid(&self) -> Result<(), InvalidResourceError>

Source

pub fn destroy(self: &Arc<Self>)

Source

pub fn create_view( self: &Arc<Self>, desc: &TextureViewDescriptor<'_>, ) -> Arc<TextureView> ⓘ

Source

pub fn descriptor(&self) -> &TextureDescriptor<String, Vec<TextureFormat>>

Source

pub fn mark_uninitialized(&self)

Marks the texture’s entire contents as uninitialized, indicating that it must be fully initialized (zeroed) before being used.

This is useful when you want zeroize texture, but want to defer the actual action to when it’s actually needed, which allows to eliding the zeroing if the texture is never actually read.

Source

pub unsafe fn mark_externally_initialized(&self)

Marks the texture’s entire contents as already initialized, skipping wgpu-core’s lazy zero-initialization of it.

§Safety

The entire contents of the texture must already be initialized.

Trait Implementations§

Source§

impl Borrow<TextureSelector> for Texture

Source§

fn borrow(&self) -> &TextureSelector

Immutably borrows from an owned value. Read more
Source§

impl Debug for Texture

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Texture

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Labeled for Texture

Source§

fn label(&self) -> &str

Returns a string identifying this resource for logging and errors. Read more
Source§

fn error_ident(&self) -> ResourceErrorIdent

Source§

impl ParentDevice for Texture

Source§

fn device(&self) -> &Arc<Device> ⓘ

Source§

fn is_equal(self: &Arc<Self>, other: &Arc<Self>) -> bool

Source§

fn same_device_as<O: ParentDevice>(&self, other: &O) -> Result<(), DeviceError>

Source§

fn same_device(&self, device: &Device) -> Result<(), DeviceError>

Source§

impl RawResourceAccess for Texture

Source§

type DynResource = dyn DynTexture

Source§

fn raw<'a>( &'a self, guard: &'a SnatchGuard<'_>, ) -> Option<&'a Self::DynResource>

Get access to the raw resource if it is not destroyed. Read more
Source§

fn try_raw<'a>( &'a self, guard: &'a SnatchGuard<'_>, ) -> Result<&'a Self::DynResource, DestroyedResourceError>

Get access to the raw resource if it is not destroyed. Read more
Source§

impl ResourceType for Texture

Source§

const TYPE: &'static str = "Texture"

Auto Trait Implementations§

§

impl !Freeze for Texture

§

impl !RefUnwindSafe for Texture

§

impl !UnwindSafe for Texture

§

impl Forget for Texture

§

impl Move for Texture

§

impl Send for Texture
where BoxRaw<dyn DynTexture>: Send, BoxRaw<dyn DynSurfaceTexture>: Send, Arc<Device>: Send, RawVecInner: Send, InternalBitFlags: Send, InternalBitFlags: Send, InternalBitFlags: Send, RwLock<RawRwLock, TextureInitTracker>: Send, InternalBitFlags: Send, Arc<SharedTrackerIndexAllocator>: Send, RwLock<RawRwLock, TextureClearMode>: Send, Mutex<RawMutex, WeakVec<TextureView>>: Send, Mutex<RawMutex, WeakVec<BindGroup>>: Send,

§

impl Sync for Texture
where SnatchableInner<Option<TextureInner>>: Sync, Arc<Device>: Sync, RawVecInner: Sync, InternalBitFlags: Sync, InternalBitFlags: Sync, InternalBitFlags: Sync, RwLock<RawRwLock, TextureInitTracker>: Sync, InternalBitFlags: Sync, Arc<SharedTrackerIndexAllocator>: Sync, RwLock<RawRwLock, TextureClearMode>: Sync, Mutex<RawMutex, WeakVec<TextureView>>: Sync, Mutex<RawMutex, WeakVec<BindGroup>>: Sync,

§

impl Unpin for Texture
where Box<dyn DynTexture>: Unpin, Box<dyn DynSurfaceTexture>: Unpin, Arc<Device>: Unpin, *const u8 is !null: Unpin, InternalBitFlags: Unpin, InternalBitFlags: Unpin, InternalBitFlags: Unpin, Align8<usize>: Unpin, *const Range<u32> is !null: Unpin, Range<u32>: Unpin, InternalBitFlags: Unpin, Arc<SharedTrackerIndexAllocator>: Unpin, Box<dyn DynTextureView>: Unpin, *const Box<dyn DynTextureView> is !null: Unpin, &'static [TextureAspect]: Unpin, Align1<u8>: Unpin, *const ArcInner<TextureView> is !null: Unpin, *const ArcInner<BindGroup> is !null: Unpin,

§

impl UnsafeUnpin for Texture

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,