logo

Enum luminance::texture::TexelUpload[][src]

pub enum TexelUpload<'a, T> where
    T: ?Sized
{ BaseLevel { texels: &'a T, mipmaps: usize, }, Levels(&'a [&'a T]), Reserve { mipmaps: usize, }, }
Expand description

Texel upload.

You have the choice between different options regarding mipmaps.:

  • You can upload texels and let mipmaps being automatically created for you.
  • You can upload texels and disable mipmap creation.
  • You can upload texels by manually providing all the mipmap levels.

Variants

BaseLevel

Fields

texels: &'a T

Texels list to upload.

mipmaps: usize

Whether mipmap levels should be automatically created.

Use 0 if you don’t want any mipmap.

Provide the base level and whether mipmaps should be generated.

Levels(&'a [&'a T])

Tuple Fields

Provide all the levels at once.

The number of elements in the outer slice represents the number of mipmaps; each inner slice represents the texels to be uploaded to the mipmap level.

Reserve

Fields

mipmaps: usize

Number of mipmap levels to allocate.

Use 0 if you don’t want any.

Reserve only the base level and optional mipmap levels.

This variant allows you not to pass any texel data and ask the backend to just reserve the memory for the texture. This will allow to pass data later, and let the backend fill the data for you. The texture texels will be set in a vendor-specific way, so you should assume that the texture will be filled with garbage.

Implementations

Create a texel upload for the base level of a texture and let mipmap levels be automatically created.

Create a texel upload by reserving memory and let mipmap levels be reserved as well.

Create a texel upload by manually providing all base + mipmap levels.

Number of mipmaps.

Get the base level texels.

Trait Implementations

Formats the value using the given formatter. 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 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.