Struct wgpu::Texture

source ·
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§

Available on non-WebAssembly or crate feature emscripten only.

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

Creates a view of this texture.

Destroy the associated native resources as soon as possible.

Make an ImageCopyTexture representing the whole texture.

Returns the size of this Texture.

This is always equal to the size that was specified when creating the texture.

Returns the width of this Texture.

This is always equal to the size.width that was specified when creating the texture.

Returns the height of this Texture.

This is always equal to the size.height that was specified when creating the texture.

Returns the depth or layer count of this Texture.

This is always equal to the size.depth_or_array_layers that was specified when creating the texture.

Returns the mip_level_count of this Texture.

This is always equal to the mip_level_count that was specified when creating the texture.

Returns the sample_count of this Texture.

This is always equal to the sample_count that was specified when creating the texture.

Returns the dimension of this Texture.

This is always equal to the dimension that was specified when creating the texture.

Returns the format of this Texture.

This is always equal to the format that was specified when creating the texture.

Returns the allowed usages of this Texture.

This is always equal to the usage that was specified when creating the texture.

Available on crate feature expose-ids only.

Returns a globally-unique identifier for this Texture.

Calling this method multiple times on the same object will always return the same value. The returned value is guaranteed to be different for all resources created from the same Instance.

Trait Implementations§

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.