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§
source§impl 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.