Fixed AttachmentImage reporting incorrect layer level access. (#1690)

* Fix AttachmentImage reporting incorrect layer level access.

* Add layer count to AttachmentImage::dimensions()
This commit is contained in:
funmaker 2021-09-04 06:30:29 +02:00 committed by GitHub
parent cd8302328f
commit 0286a708c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -478,11 +478,11 @@ impl AttachmentImage {
}
impl<A> AttachmentImage<A> {
/// Returns the dimensions of the image.
/// Returns the width, height and layers of the image.
#[inline]
pub fn dimensions(&self) -> [u32; 2] {
pub fn dimensions(&self) -> [u32; 3] {
let dims = self.image.dimensions();
[dims.width(), dims.height()]
[dims.width(), dims.height(), dims.array_layers()]
}
}
@ -598,7 +598,7 @@ unsafe impl<A> ImageAccess for AttachmentImage<A> {
#[inline]
fn current_layer_levels_access(&self) -> std::ops::Range<u32> {
0..1
0..self.dimensions()[2]
}
}