Struct vulkano::image::sys::UnsafeImage

source ·
pub struct UnsafeImage { /* private fields */ }
Expand description

A storage for pixels or arbitrary data.

Safety

This type is not just unsafe but very unsafe. Don’t use it directly.

  • You must manually bind memory to the image with bind_memory. The memory must respect the requirements returned by new.
  • The memory that you bind to the image must be manually kept alive.
  • The queue family ownership must be manually enforced.
  • The usage must be manually enforced.
  • The image layout must be manually enforced and transitioned.

Implementations

Creates a new image and allocates memory for it.

Panic
  • Panics if one of the dimensions is 0.
  • Panics if the number of mipmaps is 0.
  • Panics if the number of samples is 0.

Creates an image from a raw handle. The image won’t be destroyed.

This function is for example used at the swapchain’s initialization.

Returns a key unique to each UnsafeImage. Can be used for the conflicts_key method.

Queries the layout of an image in memory. Only valid for images with linear tiling.

This function is only valid for images with a color format. See the other similar functions for the other aspects.

The layout is invariant for each image. However it is not cached, as this would waste memory in the case of non-linear-tiling images. You are encouraged to store the layout somewhere in order to avoid calling this semi-expensive function at every single memory access.

Note that while Vulkan allows querying the array layers other than 0, it is redundant as you can easily calculate the position of any layer.

Panic
  • Panics if the mipmap level is out of range.
Safety
  • The image must not have a depth, stencil or depth-stencil format.
  • The image must have been created with linear tiling.

Same as color_linear_layout, except that it retrieves the depth component of the image.

Panic
  • Panics if the mipmap level is out of range.
Safety
  • The image must have a depth or depth-stencil format.
  • The image must have been created with linear tiling.

Same as color_linear_layout, except that it retrieves the stencil component of the image.

Panic
  • Panics if the mipmap level is out of range.
Safety
  • The image must have a stencil or depth-stencil format.
  • The image must have been created with linear tiling.

Returns true if the image can be used as a source for blits.

Returns true if the image can be used as a destination for blits.

Returns true if the image can be sampled with a linear filtering.

Trait Implementations

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
The type of the object.
The DebugReportObjectTypeEXT of the internal Vulkan handle.
Returns a reference to the object.

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
Builds a pointer to this type from a raw pointer.
Returns true if the size is suitable to store a type like this.
Returns the size of an individual element.

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.