pub struct Texture<D>where
D: TextureDimensions,{
pub view: TextureView,
pub format: TextureFormat,
pub size: D,
pub usage: TextureUsages,
/* private fields */
}Fields§
§view: TextureView§format: TextureFormat§size: D§usage: TextureUsagesImplementations§
Source§impl<D> Texture<D>where
D: TextureDimensions,
impl<D> Texture<D>where
D: TextureDimensions,
pub fn attach_render(&self) -> RenderAttachment<'_>
pub fn attach_depth(&self) -> DepthAttachment<'_>
pub fn attach_stencil(&self) -> DepthAttachment<'_>
pub fn attach_depth_stencil(&self) -> DepthAttachment<'_>
Source§impl<D> Texture<D>where
D: TextureDimensions,
impl<D> Texture<D>where
D: TextureDimensions,
Sourcepub fn bind_texture(&self) -> Binding<'_>
pub fn bind_texture(&self) -> Binding<'_>
Create a textureview binding.
Sourcepub fn bind_storage_texture(&self) -> Binding<'_>
pub fn bind_storage_texture(&self) -> Binding<'_>
Create a storage texture binding.
Source§impl<D> Texture<D>where
D: TextureDimensions,
impl<D> Texture<D>where
D: TextureDimensions,
Sourcepub fn resize(&mut self, size: D)
pub fn resize(&mut self, size: D)
Resize the texture. Old contents are discarded (see resize_and_copy)
Sourcepub fn resize_with_copy(&mut self, size: D)
pub fn resize_with_copy(&mut self, size: D)
Resize the texture and copy the contents
pub fn write<T>(&self, size: D, data: &[T])where
T: Pod,
pub fn write_block<T>(&self, texel: D, size: D, data: &[T])where
T: Pod,
pub fn read_immediately(&self) -> Result<DownloadBuffer, BufferAsyncError>
Methods from Deref<Target = Texture>§
Sourcepub unsafe fn as_hal<A, F>(&self, hal_texture_callback: F)
pub unsafe fn as_hal<A, F>(&self, hal_texture_callback: F)
Returns the inner hal Texture using a callback. The hal texture will be None if the
backend type argument does not match with this wgpu Texture
§Safety
- The raw handle obtained from the hal Texture must not be manually destroyed
Sourcepub fn create_view(&self, desc: &TextureViewDescriptor<'_>) -> TextureView
pub fn create_view(&self, desc: &TextureViewDescriptor<'_>) -> TextureView
Creates a view of this texture.
Sourcepub fn as_image_copy(&self) -> ImageCopyTexture<&Texture>
pub fn as_image_copy(&self) -> ImageCopyTexture<&Texture>
Make an ImageCopyTexture representing the whole texture.
Trait Implementations§
Source§impl<D> Deref for Texture<D>where
D: TextureDimensions,
impl<D> Deref for Texture<D>where
D: TextureDimensions,
Auto Trait Implementations§
impl<D> Freeze for Texture<D>where
D: Freeze,
impl<D> !RefUnwindSafe for Texture<D>
impl<D> !Send for Texture<D>
impl<D> !Sync for Texture<D>
impl<D> Unpin for Texture<D>where
D: Unpin,
impl<D> !UnwindSafe for Texture<D>
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