pub struct Texture { /* private fields */ }Implementations§
Source§impl Texture
impl Texture
pub fn invalid(device: &Arc<Device>, desc: &TextureDescriptor<'_>) -> Arc<Self> ⓘ
Sourcepub fn texture_binding_view_dimension(&self) -> Option<TextureViewDimension>
pub fn texture_binding_view_dimension(&self) -> Option<TextureViewDimension>
Return the resolved texture binding view dimension.
Source§impl Texture
impl Texture
pub fn check_valid(&self) -> Result<(), InvalidResourceError>
pub fn destroy(self: &Arc<Self>)
pub fn create_view( self: &Arc<Self>, desc: &TextureViewDescriptor<'_>, ) -> Arc<TextureView> ⓘ
pub fn descriptor(&self) -> &TextureDescriptor<String, Vec<TextureFormat>>
Sourcepub fn mark_uninitialized(&self)
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.
Sourcepub unsafe fn mark_externally_initialized(&self)
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
impl Borrow<TextureSelector> for Texture
Source§fn borrow(&self) -> &TextureSelector
fn borrow(&self) -> &TextureSelector
Immutably borrows from an owned value. Read more
Source§impl Labeled for Texture
impl Labeled for Texture
Source§fn label(&self) -> &str
fn label(&self) -> &str
Returns a string identifying this resource for logging and errors. Read more
fn error_ident(&self) -> ResourceErrorIdent
Source§impl ParentDevice for Texture
impl ParentDevice for Texture
Source§impl RawResourceAccess for Texture
impl RawResourceAccess for Texture
type DynResource = dyn DynTexture
Source§fn raw<'a>(
&'a self,
guard: &'a SnatchGuard<'_>,
) -> Option<&'a Self::DynResource>
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>
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
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 Texturewhere
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 Texturewhere
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 Texturewhere
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 Texturewhere
*const dyn DynTexture is !null: UnsafeUnpin,
PhantomData<dyn DynTexture>: UnsafeUnpin,
*const dyn DynSurfaceTexture is !null: UnsafeUnpin,
PhantomData<dyn DynSurfaceTexture>: UnsafeUnpin,
*const ArcInner<Device> is !null: UnsafeUnpin,
PhantomData<ArcInner<Device>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
InternalBitFlags: UnsafeUnpin,
PhantomData<TextureFormat>: UnsafeUnpin,
InternalBitFlags: UnsafeUnpin,
InternalBitFlags: UnsafeUnpin,
Align8<usize>: UnsafeUnpin,
*const Range<u32> is !null: UnsafeUnpin,
PhantomData<Range<u32>>: UnsafeUnpin,
InternalBitFlags: UnsafeUnpin,
*const ArcInner<SharedTrackerIndexAllocator> is !null: UnsafeUnpin,
PhantomData<ArcInner<SharedTrackerIndexAllocator>>: UnsafeUnpin,
*const dyn DynTextureView is !null: UnsafeUnpin,
PhantomData<dyn DynTextureView>: UnsafeUnpin,
*const Box<dyn DynTextureView> is !null: UnsafeUnpin,
PhantomData<Box<dyn DynTextureView>>: UnsafeUnpin,
&'static [TextureAspect]: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
PhantomData<Weak<TextureView>>: UnsafeUnpin,
PhantomData<Weak<BindGroup>>: 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