mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-26 08:45:59 +00:00
Additional check_copy_buffer_image checks (#1703)
* additional check_copy_buffer_image checks * rustfmt
This commit is contained in:
parent
7b306f4952
commit
dc84f31120
@ -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())?;
|
||||
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user