mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-25 16:25:31 +00:00
parent
f3205183ed
commit
046af69be5
@ -1024,12 +1024,16 @@ impl RawImage {
|
||||
}
|
||||
};
|
||||
|
||||
let memory_requirements = if flags.intersects(ImageCreateFlags::DISJOINT) {
|
||||
(0..format.unwrap().planes().len())
|
||||
.map(|plane| Self::get_memory_requirements(&device, handle, Some(plane)))
|
||||
.collect()
|
||||
let memory_requirements = if needs_destruction {
|
||||
if flags.intersects(ImageCreateFlags::DISJOINT) {
|
||||
(0..format.unwrap().planes().len())
|
||||
.map(|plane| Self::get_memory_requirements(&device, handle, Some(plane)))
|
||||
.collect()
|
||||
} else {
|
||||
smallvec![Self::get_memory_requirements(&device, handle, None)]
|
||||
}
|
||||
} else {
|
||||
smallvec![Self::get_memory_requirements(&device, handle, None)]
|
||||
smallvec![]
|
||||
};
|
||||
|
||||
RawImage {
|
||||
@ -1605,6 +1609,7 @@ impl RawImage {
|
||||
|
||||
/// Returns the memory requirements for this image.
|
||||
///
|
||||
/// - If the image is a swapchain image, this returns a slice with a length of 0.
|
||||
/// - If `self.flags().disjoint` is not set, this returns a slice with a length of 1.
|
||||
/// - If `self.flags().disjoint` is set, this returns a slice with a length equal to
|
||||
/// `self.format().unwrap().planes().len()`.
|
||||
@ -2086,6 +2091,7 @@ impl Image {
|
||||
|
||||
/// Returns the memory requirements for this image.
|
||||
///
|
||||
/// - If the image is a swapchain image, this returns a slice with a length of 0.
|
||||
/// - If `self.flags().disjoint` is not set, this returns a slice with a length of 1.
|
||||
/// - If `self.flags().disjoint` is set, this returns a slice with a length equal to
|
||||
/// `self.format().unwrap().planes().len()`.
|
||||
|
Loading…
Reference in New Issue
Block a user