diff --git a/vulkano/src/command_buffer/validity/copy_image_buffer.rs b/vulkano/src/command_buffer/validity/copy_image_buffer.rs index 91723733..10af323a 100644 --- a/vulkano/src/command_buffer/validity/copy_image_buffer.rs +++ b/vulkano/src/command_buffer/validity/copy_image_buffer.rs @@ -14,6 +14,7 @@ use crate::format::Format; use crate::format::IncompatiblePixelsType; use crate::format::Pixel; use crate::image::ImageAccess; +use crate::image::ImageDimensions; use crate::image::SampleCount; use crate::DeviceSize; use crate::VulkanObject; @@ -106,6 +107,32 @@ where return Err(CheckCopyBufferImageError::ImageCoordinatesOutOfRange); } + match image.dimensions() { + ImageDimensions::Dim1d { .. } => { + // VUID-vkCmdCopyBufferToImage-srcImage-00199 + if image_offset[1] != 0 || image_size[1] != 1 { + return Err(CheckCopyBufferImageError::ImageCoordinatesOutOfRange); + } + + // VUID-vkCmdCopyBufferToImage-srcImage-00201 + if image_offset[2] != 0 || image_size[2] != 1 { + return Err(CheckCopyBufferImageError::ImageCoordinatesOutOfRange); + } + } + ImageDimensions::Dim2d { .. } => { + // VUID-vkCmdCopyBufferToImage-srcImage-00201 + if image_offset[2] != 0 || image_size[2] != 1 { + return Err(CheckCopyBufferImageError::ImageCoordinatesOutOfRange); + } + } + ImageDimensions::Dim3d { .. } => { + // VUID-vkCmdCopyBufferToImage-baseArrayLayer-00213 + if image_first_layer != 0 || image_num_layers != 1 { + return Err(CheckCopyBufferImageError::ImageCoordinatesOutOfRange); + } + } + } + Px::ensure_accepts(image.format())?; {