// Check elements of a VkOffset3D structure against a queue family's Image Transfer Granularity values
static inline bool CheckItgOffset(layer_data *device_data, const GLOBAL_CB_NODE *cb_node, const VkOffset3D *offset,
- const VkExtent3D *granularity, const uint32_t i, const char *function, const char *member) {
+ const VkExtent3D *granularity, const uint32_t i, const char *function, const char *member,
+ UNIQUE_VALIDATION_ERROR_CODE vuid) {
const debug_report_data *report_data = core_validation::GetReportData(device_data);
bool skip = false;
VkExtent3D offset_extent = {};
// If the queue family image transfer granularity is (0, 0, 0), then the offset must always be (0, 0, 0)
if (IsExtentAllZeroes(&offset_extent) == false) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- HandleToUint64(cb_node->commandBuffer), DRAWSTATE_IMAGE_TRANSFER_GRANULARITY,
+ HandleToUint64(cb_node->commandBuffer), vuid,
"%s: pRegion[%d].%s (x=%d, y=%d, z=%d) must be (x=0, y=0, z=0) when the command buffer's queue family "
"image transfer granularity is (w=0, h=0, d=0).",
function, i, member, offset->x, offset->y, offset->z);
// integer multiples of the image transfer granularity.
if (IsExtentAligned(&offset_extent, granularity) == false) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- HandleToUint64(cb_node->commandBuffer), DRAWSTATE_IMAGE_TRANSFER_GRANULARITY,
+ HandleToUint64(cb_node->commandBuffer), vuid,
"%s: pRegion[%d].%s (x=%d, y=%d, z=%d) dimensions must be even integer multiples of this command "
"buffer's queue family image transfer granularity (w=%d, h=%d, d=%d).",
function, i, member, offset->x, offset->y, offset->z, granularity->width, granularity->height,
// Check elements of a VkExtent3D structure against a queue family's Image Transfer Granularity values
static inline bool CheckItgExtent(layer_data *device_data, const GLOBAL_CB_NODE *cb_node, const VkExtent3D *extent,
const VkOffset3D *offset, const VkExtent3D *granularity, const VkExtent3D *subresource_extent,
- const VkImageType image_type, const uint32_t i, const char *function, const char *member) {
+ const VkImageType image_type, const uint32_t i, const char *function, const char *member,
+ UNIQUE_VALIDATION_ERROR_CODE vuid) {
const debug_report_data *report_data = core_validation::GetReportData(device_data);
bool skip = false;
if (IsExtentAllZeroes(granularity)) {
// subresource extent.
if (IsExtentEqual(extent, subresource_extent) == false) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- HandleToUint64(cb_node->commandBuffer), DRAWSTATE_IMAGE_TRANSFER_GRANULARITY,
+ HandleToUint64(cb_node->commandBuffer), vuid,
"%s: pRegion[%d].%s (w=%d, h=%d, d=%d) must match the image subresource extents (w=%d, h=%d, d=%d) "
"when the command buffer's queue family image transfer granularity is (w=0, h=0, d=0).",
function, i, member, extent->width, extent->height, extent->depth, subresource_extent->width,
}
if (!(x_ok && y_ok && z_ok)) {
skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- HandleToUint64(cb_node->commandBuffer), DRAWSTATE_IMAGE_TRANSFER_GRANULARITY,
+ HandleToUint64(cb_node->commandBuffer), vuid,
"%s: pRegion[%d].%s (w=%d, h=%d, d=%d) dimensions must be even integer multiples of this command "
"buffer's queue family image transfer granularity (w=%d, h=%d, d=%d) or offset (x=%d, y=%d, z=%d) + "
"extent (w=%d, h=%d, d=%d) must match the image subresource extents (w=%d, h=%d, d=%d).",
// Check valid usage Image Transfer Granularity requirements for elements of a VkBufferImageCopy structure
bool ValidateCopyBufferImageTransferGranularityRequirements(layer_data *device_data, const GLOBAL_CB_NODE *cb_node,
const IMAGE_STATE *img, const VkBufferImageCopy *region,
- const uint32_t i, const char *function) {
+ const uint32_t i, const char *function,
+ UNIQUE_VALIDATION_ERROR_CODE vuid) {
bool skip = false;
- if (FormatIsCompressed(img->createInfo.format) == true) {
- // TODO: Add granularity checking for compressed formats
-
- // bufferRowLength must be a multiple of the compressed texel block width
- // bufferImageHeight must be a multiple of the compressed texel block height
- // all members of imageOffset must be a multiple of the corresponding dimensions of the compressed texel block
- // bufferOffset must be a multiple of the compressed texel block size in bytes
- // imageExtent.width must be a multiple of the compressed texel block width or (imageExtent.width + imageOffset.x)
- // must equal the image subresource width
- // imageExtent.height must be a multiple of the compressed texel block height or (imageExtent.height + imageOffset.y)
- // must equal the image subresource height
- // imageExtent.depth must be a multiple of the compressed texel block depth or (imageExtent.depth + imageOffset.z)
- // must equal the image subresource depth
- } else {
- VkExtent3D granularity = GetScaledItg(device_data, cb_node, img);
- skip |= CheckItgOffset(device_data, cb_node, ®ion->imageOffset, &granularity, i, function, "imageOffset");
- VkExtent3D subresource_extent = GetImageSubresourceExtent(img, ®ion->imageSubresource);
- skip |= CheckItgExtent(device_data, cb_node, ®ion->imageExtent, ®ion->imageOffset, &granularity, &subresource_extent,
- img->createInfo.imageType, i, function, "imageExtent");
- }
+ VkExtent3D granularity = GetScaledItg(device_data, cb_node, img);
+ skip |= CheckItgOffset(device_data, cb_node, ®ion->imageOffset, &granularity, i, function, "imageOffset", vuid);
+ VkExtent3D subresource_extent = GetImageSubresourceExtent(img, ®ion->imageSubresource);
+ skip |= CheckItgExtent(device_data, cb_node, ®ion->imageExtent, ®ion->imageOffset, &granularity, &subresource_extent,
+ img->createInfo.imageType, i, function, "imageExtent", vuid);
return skip;
}
bool skip = false;
// Source image checks
VkExtent3D granularity = GetScaledItg(device_data, cb_node, src_img);
- skip |= CheckItgOffset(device_data, cb_node, ®ion->srcOffset, &granularity, i, function, "srcOffset");
+ skip |=
+ CheckItgOffset(device_data, cb_node, ®ion->srcOffset, &granularity, i, function, "srcOffset", VALIDATION_ERROR_19000dee);
VkExtent3D subresource_extent = GetImageSubresourceExtent(src_img, ®ion->srcSubresource);
const VkExtent3D extent = region->extent;
skip |= CheckItgExtent(device_data, cb_node, &extent, ®ion->srcOffset, &granularity, &subresource_extent,
- src_img->createInfo.imageType, i, function, "extent");
+ src_img->createInfo.imageType, i, function, "extent", VALIDATION_ERROR_19000dee);
// Destination image checks
granularity = GetScaledItg(device_data, cb_node, dst_img);
- skip |= CheckItgOffset(device_data, cb_node, ®ion->dstOffset, &granularity, i, function, "dstOffset");
+ skip |=
+ CheckItgOffset(device_data, cb_node, ®ion->dstOffset, &granularity, i, function, "dstOffset", VALIDATION_ERROR_19000df0);
// Adjust dest extent, if necessary
const VkExtent3D dest_effective_extent =
GetAdjustedDestImageExtent(src_img->createInfo.format, dst_img->createInfo.format, extent);
subresource_extent = GetImageSubresourceExtent(dst_img, ®ion->dstSubresource);
skip |= CheckItgExtent(device_data, cb_node, &dest_effective_extent, ®ion->dstOffset, &granularity, &subresource_extent,
- dst_img->createInfo.imageType, i, function, "extent");
+ dst_img->createInfo.imageType, i, function, "extent", VALIDATION_ERROR_19000df0);
return skip;
}
}
// Checks that apply only to compressed images
- // TODO: there is a comment in ValidateCopyBufferImageTransferGranularityRequirements() in core_validation.cpp that
- // reserves a place for these compressed image checks. This block of code could move there once the image
- // stuff is moved into core validation.
- if (FormatIsCompressed(image_state->createInfo.format)) {
+ if (FormatIsCompressed(image_state->createInfo.format) || FormatIsSinglePlane_422(image_state->createInfo.format)) {
auto block_size = FormatCompressedTexelBlockExtent(image_state->createInfo.format);
// BufferRowLength must be a multiple of block width
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, "vkCmdCopyImageToBuffer()", VALIDATION_ERROR_1920017c,
&hit_error);
skip |= ValidateCopyBufferImageTransferGranularityRequirements(device_data, cb_node, src_image_state, &pRegions[i], i,
- "vkCmdCopyImageToBuffer()");
+ "vkCmdCopyImageToBuffer()", VALIDATION_ERROR_19200e04);
}
return skip;
}
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, "vkCmdCopyBufferToImage()", VALIDATION_ERROR_18e0016a,
&hit_error);
skip |= ValidateCopyBufferImageTransferGranularityRequirements(device_data, cb_node, dst_image_state, &pRegions[i], i,
- "vkCmdCopyBufferToImage()");
+ "vkCmdCopyBufferToImage()", VALIDATION_ERROR_18e00e02);
}
return skip;
}
bool ValidateCopyBufferImageTransferGranularityRequirements(layer_data *device_data, const GLOBAL_CB_NODE *cb_node,
const IMAGE_STATE *img, const VkBufferImageCopy *region,
- const uint32_t i, const char *function);
+ const uint32_t i, const char *function,
+ UNIQUE_VALIDATION_ERROR_CODE vuid);
void PreCallRecordCmdCopyImage(layer_data *device_data, GLOBAL_CB_NODE *cb_node, IMAGE_STATE *src_image_state,
IMAGE_STATE *dst_image_state, uint32_t region_count, const VkImageCopy *regions,
VALIDATION_ERROR_18e00ae8~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-dstImageLayout-01396~^~(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'dstImageLayout must be VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-dstImageLayout-01396)~^~
VALIDATION_ERROR_18e00d4a~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-imageSubresource-01701~^~core~^~The spec valid usage text states 'The imageSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-imageSubresource-01701)~^~
VALIDATION_ERROR_18e00d4c~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-imageSubresource-01702~^~core~^~The spec valid usage text states 'The imageSubresource.baseArrayLayer + imageSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-imageSubresource-01702)~^~
-VALIDATION_ERROR_18e00e02~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-imageOffset-01793~^~core~^~The spec valid usage text states 'The imageOffset and and imageExtent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-imageOffset-01793)~^~
+VALIDATION_ERROR_18e00e02~^~Y~^~CompressedImageMipCopyTests~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-imageOffset-01793~^~core~^~The spec valid usage text states 'The imageOffset and and imageExtent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyBufferToImage-imageOffset-01793)~^~
VALIDATION_ERROR_18e00e48~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-commandBuffer-01828~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-01828)~^~
VALIDATION_ERROR_18e00e4a~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-commandBuffer-01829~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-01829)~^~
VALIDATION_ERROR_18e00e4c~^~N~^~None~^~vkCmdCopyBufferToImage~^~VUID-vkCmdCopyBufferToImage-commandBuffer-01830~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyBufferToImage-commandBuffer-01830)~^~
VALIDATION_ERROR_19000d42~^~Y~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstSubresource-01697~^~core~^~The spec valid usage text states 'The dstSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstSubresource-01697)~^~
VALIDATION_ERROR_19000d44~^~Y~^~CopyImageTypeExtentMismatch~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcSubresource-01698~^~core~^~The spec valid usage text states 'The srcSubresource.baseArrayLayer + srcSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcSubresource-01698)~^~
VALIDATION_ERROR_19000d46~^~Y~^~CopyImageTypeExtentMismatch~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstSubresource-01699~^~core~^~The spec valid usage text states 'The dstSubresource.baseArrayLayer + dstSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstSubresource-01699)~^~
-VALIDATION_ERROR_19000dee~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcOffset-01783~^~core~^~The spec valid usage text states 'The srcOffset and and extent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcOffset-01783)~^~
-VALIDATION_ERROR_19000df0~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstOffset-01784~^~core~^~The spec valid usage text states 'The dstOffset and and extent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstOffset-01784)~^~
+VALIDATION_ERROR_19000dee~^~Y~^~DSImageTransferGranularityTests~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-srcOffset-01783~^~core~^~The spec valid usage text states 'The srcOffset and and extent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-srcOffset-01783)~^~
+VALIDATION_ERROR_19000df0~^~Y~^~DSImageTransferGranularityTests~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-dstOffset-01784~^~core~^~The spec valid usage text states 'The dstOffset and and extent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImage-dstOffset-01784)~^~
VALIDATION_ERROR_19000e42~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-commandBuffer-01825~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-01825)~^~
VALIDATION_ERROR_19000e44~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-commandBuffer-01826~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-01826)~^~
VALIDATION_ERROR_19000e46~^~N~^~None~^~vkCmdCopyImage~^~VUID-vkCmdCopyImage-commandBuffer-01827~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstImage must not be an unprotected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImage-commandBuffer-01827)~^~
VALIDATION_ERROR_19200aea~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-srcImageLayout-01397~^~(VK_KHR_shared_presentable_image)~^~The spec valid usage text states 'srcImageLayout must be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-srcImageLayout-01397)~^~
VALIDATION_ERROR_19200d4e~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-imageSubresource-01703~^~core~^~The spec valid usage text states 'The imageSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-imageSubresource-01703)~^~
VALIDATION_ERROR_19200d50~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-imageSubresource-01704~^~core~^~The spec valid usage text states 'The imageSubresource.baseArrayLayer + imageSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when srcImage was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-imageSubresource-01704)~^~
-VALIDATION_ERROR_19200e04~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-imageOffset-01794~^~core~^~The spec valid usage text states 'The imageOffset and and imageExtent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-imageOffset-01794)~^~
+VALIDATION_ERROR_19200e04~^~Y~^~CompressedImageMipCopyTests~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-imageOffset-01794~^~core~^~The spec valid usage text states 'The imageOffset and and imageExtent members of each element of pRegions must respect the image transfer granularity requirements of commandBuffer's command pool's queue family, as described in VkQueueFamilyProperties' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-imageOffset-01794)~^~
VALIDATION_ERROR_19200e4e~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-commandBuffer-01831~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then srcImage must not be a protected image' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-01831)~^~
VALIDATION_ERROR_19200e50~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-commandBuffer-01832~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-01832)~^~
VALIDATION_ERROR_19200e52~^~N~^~None~^~vkCmdCopyImageToBuffer~^~VUID-vkCmdCopyImageToBuffer-commandBuffer-01833~^~(VK_VERSION_1_1)~^~The spec valid usage text states 'If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-vkCmdCopyImageToBuffer-commandBuffer-01833)~^~
if ((queue_family_properties[index].minImageTransferGranularity.depth < 4) ||
(queue_family_properties[index].minImageTransferGranularity.width < 4) ||
(queue_family_properties[index].minImageTransferGranularity.height < 4)) {
+ printf(" Image transfer granularity is too small to test meaningfully. Skipping.\n");
return;
}
// Introduce failure by setting srcOffset to a bad granularity value
copyRegion.srcOffset.y = 3;
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "queue family image transfer granularity");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_19000dee); // srcOffset image transfer granularity
m_commandBuffer->CopyImage(srcImage, VK_IMAGE_LAYOUT_GENERAL, dstImage, VK_IMAGE_LAYOUT_GENERAL, 1, ©Region);
m_errorMonitor->VerifyFound();
// Introduce failure by setting extent to a bad granularity value
copyRegion.srcOffset.y = 0;
copyRegion.extent.width = 3;
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "queue family image transfer granularity");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_19000dee); // src extent image transfer granularity
m_commandBuffer->CopyImage(srcImage, VK_IMAGE_LAYOUT_GENERAL, dstImage, VK_IMAGE_LAYOUT_GENERAL, 1, ©Region);
m_errorMonitor->VerifyFound();
// Introduce failure by setting imageExtent to a bad granularity value
region.imageExtent.width = 3;
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "queue family image transfer granularity");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_19200e04); // image transfer granularity
vkCmdCopyImageToBuffer(m_commandBuffer->handle(), srcImage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, buffer.handle(), 1, ®ion);
m_errorMonitor->VerifyFound();
region.imageExtent.width = 16;
// Introduce failure by setting imageOffset to a bad granularity value
region.imageOffset.z = 3;
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "queue family image transfer granularity");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_18e00e02); // image transfer granularity
vkCmdCopyBufferToImage(m_commandBuffer->handle(), buffer.handle(), srcImage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion);
m_errorMonitor->VerifyFound();
// Copy width < compressed block size, but not the full mip width
region.imageExtent = {1, 2, 1};
region.imageSubresource.mipLevel = 4;
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_0160019e);
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_0160019e); // width not a multiple of compressed block width
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_19200e04); // image transfer granularity
vkCmdCopyImageToBuffer(m_commandBuffer->handle(), image.handle(), VK_IMAGE_LAYOUT_GENERAL, buffer_16.handle(), 1, ®ion);
m_errorMonitor->VerifyFound();
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_0160019e);
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_0160019e); // width not a multiple of compressed block width
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_18e00e02); // image transfer granularity
vkCmdCopyBufferToImage(m_commandBuffer->handle(), buffer_16.handle(), image.handle(), VK_IMAGE_LAYOUT_GENERAL, 1, ®ion);
m_errorMonitor->VerifyFound();
// Copy height < compressed block size but not the full mip height
region.imageExtent = {2, 1, 1};
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_016001a0);
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_016001a0); // height not a multiple of compressed block width
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_19200e04); // image transfer granularity
vkCmdCopyImageToBuffer(m_commandBuffer->handle(), image.handle(), VK_IMAGE_LAYOUT_GENERAL, buffer_16.handle(), 1, ®ion);
m_errorMonitor->VerifyFound();
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_016001a0);
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_016001a0); // height not a multiple of compressed block width
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_18e00e02); // image transfer granularity
vkCmdCopyBufferToImage(m_commandBuffer->handle(), buffer_16.handle(), image.handle(), VK_IMAGE_LAYOUT_GENERAL, 1, ®ion);
m_errorMonitor->VerifyFound();
// Offsets must be multiple of compressed block size
region.imageOffset = {1, 1, 0};
region.imageExtent = {1, 1, 1};
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_0160019a);
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_0160019a); // imageOffset not a multiple of block size
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_19200e04); // image transfer granularity
vkCmdCopyImageToBuffer(m_commandBuffer->handle(), image.handle(), VK_IMAGE_LAYOUT_GENERAL, buffer_16.handle(), 1, ®ion);
m_errorMonitor->VerifyFound();
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_0160019a);
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_0160019a); // imageOffset not a multiple of block size
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_18e00e02); // image transfer granularity
vkCmdCopyBufferToImage(m_commandBuffer->handle(), buffer_16.handle(), image.handle(), VK_IMAGE_LAYOUT_GENERAL, 1, ®ion);
m_errorMonitor->VerifyFound();
// Offset + extent width < mip width and not a multiple of block width - should fail
region.imageExtent = {3, 3, 1};
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_016001a0);
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_016001a0); // offset+extent not a multiple of block width
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_19200e04); // image transfer granularity
vkCmdCopyImageToBuffer(m_commandBuffer->handle(), odd_image.handle(), VK_IMAGE_LAYOUT_GENERAL, buffer_16.handle(), 1, ®ion);
m_errorMonitor->VerifyFound();
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_016001a0);
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_016001a0); // offset+extent not a multiple of block width
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_18e00e02); // image transfer granularity
vkCmdCopyBufferToImage(m_commandBuffer->handle(), buffer_16.handle(), odd_image.handle(), VK_IMAGE_LAYOUT_GENERAL, 1, ®ion);
m_errorMonitor->VerifyFound();
}
region.bufferOffset = 0;
// extents that are not a multiple of compressed block size
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_0160019e);
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_0160019e); // extent width not a multiple of block size
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_19200e04); // image transfer granularity
region.imageExtent.width = 66;
vkCmdCopyImageToBuffer(m_commandBuffer->handle(), image_NPOT_4x4comp.handle(), VK_IMAGE_LAYOUT_GENERAL, buffer_16k.handle(),
1, ®ion);
m_errorMonitor->VerifyFound();
region.imageExtent.width = 128;
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_016001a0);
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_016001a0); // extent height not a multiple of block size
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_19200e04); // image transfer granularity
region.imageExtent.height = 2;
vkCmdCopyImageToBuffer(m_commandBuffer->handle(), image_NPOT_4x4comp.handle(), VK_IMAGE_LAYOUT_GENERAL, buffer_16k.handle(),
1, ®ion);
vuid = ycbcr ? VALIDATION_ERROR_09c00d7e : VALIDATION_ERROR_09c0013a;
copy_region.srcOffset = {2, 4, 0}; // source width
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, vuid);
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "queue family image transfer granularity");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_19000dee); // srcOffset image transfer granularity
m_commandBuffer->CopyImage(image_1.image(), VK_IMAGE_LAYOUT_GENERAL, image_2.image(), VK_IMAGE_LAYOUT_GENERAL, 1, ©_region);
m_errorMonitor->VerifyFound();
copy_region.srcOffset = {12, 1, 0}; // source height
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, vuid);
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "queue family image transfer granularity");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_19000dee); // srcOffset image transfer granularity
m_commandBuffer->CopyImage(image_1.image(), VK_IMAGE_LAYOUT_GENERAL, image_2.image(), VK_IMAGE_LAYOUT_GENERAL, 1, ©_region);
m_errorMonitor->VerifyFound();
copy_region.srcOffset = {0, 0, 0};
vuid = ycbcr ? VALIDATION_ERROR_09c00d86 : VALIDATION_ERROR_09c00144;
copy_region.dstOffset = {1, 0, 0}; // dest width
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, vuid);
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "queue family image transfer granularity");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_19000df0); // dstOffset image transfer granularity
m_commandBuffer->CopyImage(image_1.image(), VK_IMAGE_LAYOUT_GENERAL, image_2.image(), VK_IMAGE_LAYOUT_GENERAL, 1, ©_region);
m_errorMonitor->VerifyFound();
copy_region.dstOffset = {4, 1, 0}; // dest height
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, vuid);
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "queue family image transfer granularity");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_19000df0); // dstOffset image transfer granularity
m_commandBuffer->CopyImage(image_1.image(), VK_IMAGE_LAYOUT_GENERAL, image_2.image(), VK_IMAGE_LAYOUT_GENERAL, 1, ©_region);
m_errorMonitor->VerifyFound();
copy_region.dstOffset = {0, 0, 0};
vuid = ycbcr ? VALIDATION_ERROR_09c00d80 : VALIDATION_ERROR_09c0013c;
copy_region.extent = {62, 60, 1}; // source width
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, vuid);
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "queue family image transfer granularity");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_19000dee); // src extent image transfer granularity
m_commandBuffer->CopyImage(image_1.image(), VK_IMAGE_LAYOUT_GENERAL, image_2.image(), VK_IMAGE_LAYOUT_GENERAL, 1, ©_region);
m_errorMonitor->VerifyFound();
vuid = ycbcr ? VALIDATION_ERROR_09c00d82 : VALIDATION_ERROR_09c0013e;
copy_region.extent = {60, 62, 1}; // source height
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, vuid);
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "queue family image transfer granularity");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_19000dee); // src extent image transfer granularity
m_commandBuffer->CopyImage(image_1.image(), VK_IMAGE_LAYOUT_GENERAL, image_2.image(), VK_IMAGE_LAYOUT_GENERAL, 1, ©_region);
m_errorMonitor->VerifyFound();
vuid = ycbcr ? VALIDATION_ERROR_09c00d88 : VALIDATION_ERROR_09c00146;
copy_region.extent = {62, 60, 1}; // dest width
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, vuid);
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "queue family image transfer granularity");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_19000df0); // dst extent image transfer granularity
m_commandBuffer->CopyImage(image_2.image(), VK_IMAGE_LAYOUT_GENERAL, image_1.image(), VK_IMAGE_LAYOUT_GENERAL, 1, ©_region);
m_errorMonitor->VerifyFound();
vuid = ycbcr ? VALIDATION_ERROR_09c00d8a : VALIDATION_ERROR_09c00148;
copy_region.extent = {60, 62, 1}; // dest height
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, vuid);
- m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, "queue family image transfer granularity");
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT,
+ VALIDATION_ERROR_19000df0); // dst extent image transfer granularity
m_commandBuffer->CopyImage(image_2.image(), VK_IMAGE_LAYOUT_GENERAL, image_1.image(), VK_IMAGE_LAYOUT_GENERAL, 1, ©_region);
m_errorMonitor->VerifyFound();