pub struct Texture { /* private fields */ }
Expand description
Handle to a texture on the GPU.
It can be created with Device::create_texture
.
Corresponds to WebGPU GPUTexture
.
Implementations
sourceimpl Texture
impl Texture
sourcepub unsafe fn as_hal<A: HalApi, F: FnOnce(Option<&A::Texture>)>(
&self,
hal_texture_callback: F
)
pub unsafe fn as_hal<A: HalApi, F: FnOnce(Option<&A::Texture>)>(
&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<'_>
pub fn as_image_copy(&self) -> ImageCopyTexture<'_>
Make an ImageCopyTexture
representing the whole texture.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Texture
impl Send for Texture
impl Sync for Texture
impl Unpin for Texture
impl !UnwindSafe for Texture
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more