Struct draw2d::graphics::vulkan::texture::TextureImage[][src]

pub struct TextureImage { /* fields omitted */ }
Expand description

The TextureImage maintains the image, view, and memory, which are required when rendering with a texture.

Implementations

The raw image handle used by this texture.

Unsafe because it is up to the caller to synchronize access to the image.

The raw image view used by this texture.

Unsafe because it is up to the caller to synchronize access to the view.

Create the image, allocate memory, create a view for the texture.

Bytes per pixel is used by the various upload_* methods when copying data from a buffer into the image. For example, if the image format is R8G8B8A8_SRGB then the bytes per pixel is 4.

Upload a texture’s data from a buffer.

This method is just an alias to Self::upload_mipmaps_from_buffer which only updates the first mipmap. It’s particularly convenient for textures which only have a single mipmap level.

Upload a texture’s mipmaps from a buffer.

  • This method assumes that each mipmap has the same bytes_per_pixel as the texture image.
  • Order is super important. The first entry in mipmap_sizes corresponds to the first region of memory in the src bufer. The mipmap extents are used to compute the byte offset and size of each mipmap region.

Transition the image memory layout such that it is an optimal transfer target.

Trait Implementations

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

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

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.