mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-26 08:45:59 +00:00
Fix using cubemaps with immutable images
This commit is contained in:
parent
8303728870
commit
043c2ac50c
@ -111,7 +111,7 @@ impl<F> ImmutableImage<F> {
|
||||
format: format,
|
||||
per_layer: {
|
||||
let mut v = SmallVec::new();
|
||||
for _ in 0 .. dimensions.array_layers() {
|
||||
for _ in 0 .. dimensions.array_layers_with_cube() {
|
||||
v.push(PerLayer {
|
||||
latest_write_submission: Mutex::new(None),
|
||||
started_reading: AtomicBool::new(false),
|
||||
|
@ -206,6 +206,19 @@ impl Dimensions {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn array_layers_with_cube(&self) -> u32 {
|
||||
match *self {
|
||||
Dimensions::Dim1d { .. } => 1,
|
||||
Dimensions::Dim1dArray { array_layers, .. } => array_layers,
|
||||
Dimensions::Dim2d { .. } => 1,
|
||||
Dimensions::Dim2dArray { array_layers, .. } => array_layers,
|
||||
Dimensions::Dim3d { .. } => 1,
|
||||
Dimensions::Cubemap { .. } => 6,
|
||||
Dimensions::CubemapArray { array_layers, .. } => array_layers * 6,
|
||||
}
|
||||
}
|
||||
|
||||
/// Builds the corresponding `ImageDimensions`.
|
||||
#[inline]
|
||||
pub fn to_image_dimensions(&self) -> ImageDimensions {
|
||||
|
Loading…
Reference in New Issue
Block a user