pub struct Texture {
pub inner: TextureInner,
pub mip_level_count: u32,
pub array_layer_count: u32,
pub format: TextureFormat,
pub format_desc: TextureFormatDesc,
pub copy_size: CopyExtent,
pub drop_guard: Option<DropGuard>,
}Available on
gles only.Fields§
§inner: TextureInner§mip_level_count: u32§array_layer_count: u32§format: TextureFormat§format_desc: TextureFormatDesc§copy_size: CopyExtent§drop_guard: Option<DropGuard>Some marks the underlying GL object as externally owned: wgpu-hal
never deletes it (the guard’s callback, if any, fires instead).
On WebGL every handle also holds a slot in glow’s resource tracker.
destroy_texture always releases that slot: by deleting the texture
when we own it, or by unregister_external_texture when we don’t.
The drop_guard field must be the last field of this struct so it is
dropped last. Do not add new fields after it.
Implementations§
Source§impl Texture
impl Texture
pub fn default_framebuffer(format: TextureFormat) -> Self
Trait Implementations§
Source§impl Borrow<dyn DynTexture> for Texture
impl Borrow<dyn DynTexture> for Texture
Source§fn borrow(&self) -> &dyn DynTexture
fn borrow(&self) -> &dyn DynTexture
Immutably borrows from an owned value. Read more
Source§impl DynResource for Texture
impl DynResource for Texture
impl DynSurfaceTexture for Texture
impl DynTexture for Texture
Auto Trait Implementations§
impl !RefUnwindSafe for Texture
impl !UnwindSafe for Texture
impl Forget for Texture
impl Freeze for Texture
impl Move for Texture
impl Send for Texture
impl Sync for Texture
impl Unpin for Texture
impl UnsafeUnpin for Texturewhere
NativeRenderbuffer: UnsafeUnpin,
NativeTexture: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
*const dyn FnOnce() + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn FnOnce() + Sync + Send>: 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