[−][src]Struct vulkano::image::sys::UnsafeImage
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.
Methods
impl UnsafeImage
[src]
pub unsafe fn new<'a, Mi, I>(
device: Arc<Device>,
usage: ImageUsage,
format: Format,
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]
device: Arc<Device>,
usage: ImageUsage,
format: Format,
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>,
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: u32,
format: Format,
dimensions: ImageDimensions,
samples: u32,
mipmaps: u32
) -> UnsafeImage
[src]
device: Arc<Device>,
handle: u64,
usage: u32,
format: Format,
dimensions: ImageDimensions,
samples: u32,
mipmaps: u32
) -> UnsafeImage
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 mipmap_levels(&self) -> u32
[src]
pub fn dimensions(&self) -> ImageDimensions
[src]
pub fn samples(&self) -> u32
[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]
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]
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.
pub unsafe fn stencil_linear_layout(&self, mip_level: u32) -> LinearLayout
[src]
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.
pub fn supports_blit_source(&self) -> bool
[src]
Returns true if the image can be used as a source for blits.
pub fn supports_blit_destination(&self) -> bool
[src]
Returns true if the image can be used as a destination for blits.
pub fn supports_linear_filtering(&self) -> bool
[src]
Returns true if the image can be sampled with a linear filtering.
pub fn usage_transfer_source(&self) -> bool
[src]
pub fn usage_transfer_destination(&self) -> bool
[src]
pub fn usage_sampled(&self) -> bool
[src]
pub fn usage_storage(&self) -> bool
[src]
pub fn usage_color_attachment(&self) -> bool
[src]
pub fn usage_depth_stencil_attachment(&self) -> bool
[src]
pub fn usage_transient_attachment(&self) -> bool
[src]
pub fn usage_input_attachment(&self) -> bool
[src]
pub fn preinitialized_layout(&self) -> bool
[src]
Trait Implementations
impl VulkanObject for UnsafeImage
[src]
type Object = Image
The type of the object.
const TYPE: DebugReportObjectTypeEXT
[src]
fn internal_object(&self) -> Image
[src]
impl Drop for UnsafeImage
[src]
impl Debug for UnsafeImage
[src]
Auto Trait Implementations
impl Send for UnsafeImage
impl Unpin for UnsafeImage
impl Sync for UnsafeImage
impl UnwindSafe for UnsafeImage
impl RefUnwindSafe for UnsafeImage
Blanket Implementations
impl<T> Content for T
[src]
fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]
fn is_size_suitable(usize) -> bool
[src]
fn indiv_size() -> usize
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,