Struct vulkano::image::sys::UnsafeImage [−][src]
pub struct UnsafeImage { /* fields omitted */ }
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 bynew
. - 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
impl UnsafeImage
[src]
impl UnsafeImage
[src]pub unsafe fn new<'a, Mi, I>(
device: Arc<Device>,
usage: ImageUsage,
format: Format,
flags: ImageCreateFlags,
dimensions: ImageDimensions,
num_samples: u32,
mipmaps: Mi,
sharing: Sharing<I>,
linear_tiling: bool,
preinitialized_layout: bool
) -> Result<(UnsafeImage, MemoryRequirements), ImageCreationError> where
Mi: Into<MipmapsCount>,
I: Iterator<Item = u32>,
[src]
pub unsafe fn new<'a, Mi, I>(
device: Arc<Device>,
usage: ImageUsage,
format: Format,
flags: ImageCreateFlags,
dimensions: ImageDimensions,
num_samples: u32,
mipmaps: Mi,
sharing: Sharing<I>,
linear_tiling: bool,
preinitialized_layout: bool
) -> Result<(UnsafeImage, MemoryRequirements), ImageCreationError> where
Mi: Into<MipmapsCount>,
I: Iterator<Item = u32>,
[src]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.
pub unsafe fn from_raw(
device: Arc<Device>,
handle: u64,
usage: ImageUsage,
format: Format,
flags: ImageCreateFlags,
dimensions: ImageDimensions,
samples: u32,
mipmaps: u32
) -> UnsafeImage
[src]
pub unsafe fn from_raw(
device: Arc<Device>,
handle: u64,
usage: ImageUsage,
format: Format,
flags: ImageCreateFlags,
dimensions: ImageDimensions,
samples: u32,
mipmaps: u32
) -> UnsafeImage
[src]Creates an image from a raw handle. The image won’t be destroyed.
This function is for example used at the swapchain’s initialization.
pub unsafe fn bind_memory(
&self,
memory: &DeviceMemory,
offset: usize
) -> Result<(), OomError>
[src]
&self,
memory: &DeviceMemory,
offset: usize
) -> Result<(), OomError>
pub fn device(&self) -> &Arc<Device>
[src]
pub fn format(&self) -> Format
[src]
pub fn create_flags(&self) -> ImageCreateFlags
[src]
pub fn mipmap_levels(&self) -> u32
[src]
pub fn dimensions(&self) -> ImageDimensions
[src]
pub fn samples(&self) -> u32
[src]
pub fn key(&self) -> u64
[src]
pub fn key(&self) -> u64
[src]Returns a key unique to each UnsafeImage
. Can be used for the conflicts_key
method.
pub unsafe fn color_linear_layout(&self, mip_level: u32) -> LinearLayout
[src]
pub unsafe fn color_linear_layout(&self, mip_level: u32) -> LinearLayout
[src]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.
pub unsafe fn depth_linear_layout(&self, mip_level: u32) -> LinearLayout
[src]
pub unsafe fn depth_linear_layout(&self, mip_level: u32) -> LinearLayout
[src]pub unsafe fn stencil_linear_layout(&self, mip_level: u32) -> LinearLayout
[src]
pub unsafe fn stencil_linear_layout(&self, mip_level: u32) -> LinearLayout
[src]pub unsafe fn multiplane_color_layout(
&self,
aspect: ImageAspect
) -> LinearLayout
[src]
pub unsafe fn multiplane_color_layout(
&self,
aspect: ImageAspect
) -> LinearLayout
[src]Same as color_linear_layout
, except that it retrieves layout for the requested ycbcr
component too if the format is a YcbCr format.
Panic
- Panics if plane aspect is out of range.
- Panics if the aspect is not a color or planar aspect.
- Panics if the number of mipmaps is not 1.
pub fn flags(&self) -> ImageCreateFlags
[src]
pub fn flags(&self) -> ImageCreateFlags
[src]Returns the flags the image was created with.
pub fn format_features(&self) -> FormatFeatures
[src]
pub fn format_features(&self) -> FormatFeatures
[src]Returns the features supported by the image’s format.
pub fn usage(&self) -> ImageUsage
[src]
pub fn usage(&self) -> ImageUsage
[src]Returns the usage the image was created with.
pub fn preinitialized_layout(&self) -> bool
[src]
Trait Implementations
impl Debug for UnsafeImage
[src]
impl Debug for UnsafeImage
[src]impl Drop for UnsafeImage
[src]
impl Drop for UnsafeImage
[src]impl Hash for UnsafeImage
[src]
impl Hash for UnsafeImage
[src]impl PartialEq<UnsafeImage> for UnsafeImage
[src]
impl PartialEq<UnsafeImage> for UnsafeImage
[src]impl VulkanObject for UnsafeImage
[src]
impl VulkanObject for UnsafeImage
[src]const TYPE: ObjectType
[src]
const TYPE: ObjectType
[src]The ObjectType
of the internal Vulkan handle.
fn internal_object(&self) -> Image
[src]
fn internal_object(&self) -> Image
[src]Returns a reference to the object.
impl Eq for UnsafeImage
[src]
Auto Trait Implementations
impl RefUnwindSafe for UnsafeImage
impl Send for UnsafeImage
impl Sync for UnsafeImage
impl Unpin for UnsafeImage
impl UnwindSafe for UnsafeImage
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Content for T
[src]
impl<T> Content for T
[src]pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]
pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]Builds a pointer to this type from a raw pointer.
pub fn is_size_suitable(usize) -> bool
[src]
pub fn is_size_suitable(usize) -> bool
[src]Returns true if the size is suitable to store a type like this.
pub fn indiv_size() -> usize
[src]
pub fn indiv_size() -> usize
[src]Returns the size of an individual element.