skip |= ValidateCmd(device_data, cb_node, CMD_BLITIMAGE, "vkCmdBlitImage()");
skip |= insideRenderPass(device_data, cb_node, "vkCmdBlitImage()", VALIDATION_ERROR_01300);
- // Warn for zero-sized regions
for (uint32_t i = 0; i < regionCount; i++) {
+
+ // Warn for zero-sized regions
if ((pRegions[i].srcOffsets[0].x == pRegions[i].srcOffsets[1].x) ||
(pRegions[i].srcOffsets[0].y == pRegions[i].srcOffsets[1].y) ||
(pRegions[i].srcOffsets[0].z == pRegions[i].srcOffsets[1].z)) {
reinterpret_cast<uint64_t>(cb_node->commandBuffer), __LINE__, DRAWSTATE_INVALID_EXTENTS, "IMAGE",
"%s", ss.str().c_str());
}
+ if (pRegions[i].srcSubresource.layerCount == 0) {
+ char const str[] = "vkCmdBlitImage: number of layers in source subresource is zero";
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(cb_node->commandBuffer), __LINE__, DRAWSTATE_MISMATCHED_IMAGE_ASPECT,
+ "IMAGE", str);
+ }
+ if (pRegions[i].dstSubresource.layerCount == 0) {
+ char const str[] = "vkCmdBlitImage: number of layers in destination subresource is zero";
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(cb_node->commandBuffer), __LINE__, DRAWSTATE_MISMATCHED_IMAGE_ASPECT,
+ "IMAGE", str);
+ }
+
+ // Check that src/dst layercounts match
+ if (pRegions[i].srcSubresource.layerCount != pRegions[i].dstSubresource.layerCount) {
+ skip |=
+ log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ reinterpret_cast<uint64_t>(cb_node->commandBuffer), __LINE__, VALIDATION_ERROR_01304, "IMAGE",
+ "vkCmdBlitImage: layerCount in source and destination subresource of pRegions[%d] does not match. %s",
+ i, validation_error_map[VALIDATION_ERROR_01304]);
+ }
}
VkFormat src_format = src_image_state->createInfo.format;
// Validate aspect bits and formats for depth/stencil images
if (vk_format_is_depth_or_stencil(src_format) || vk_format_is_depth_or_stencil(dst_format)) {
+
if (src_format != dst_format) {
std::stringstream ss;
ss << "vkCmdBlitImage: If one of srcImage and dstImage images has a format of depth, stencil or depth "
"%s. %s", ss.str().c_str(), validation_error_map[VALIDATION_ERROR_02192]);
}
- // TODO: Confirm that all these checks are intended to be nested under depth/stencil only
for (uint32_t i = 0; i < regionCount; i++) {
- if (pRegions[i].srcSubresource.layerCount == 0) {
- char const str[] = "vkCmdBlitImage: number of layers in source subresource is zero";
- // TODO: Verify against Valid Use section of spec, if this case yields undefined results, then it's an error
- skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(cb_node->commandBuffer), __LINE__, DRAWSTATE_MISMATCHED_IMAGE_ASPECT,
- "IMAGE", str);
- }
-
- if (pRegions[i].dstSubresource.layerCount == 0) {
- char const str[] = "vkCmdBlitImage: number of layers in destination subresource is zero";
- // TODO: Verify against Valid Use section of spec, if this case yields undefined results, then it's an error
- skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(cb_node->commandBuffer), __LINE__, DRAWSTATE_MISMATCHED_IMAGE_ASPECT,
- "IMAGE", str);
- }
-
- if (pRegions[i].srcSubresource.layerCount != pRegions[i].dstSubresource.layerCount) {
- char const str[] = "vkCmdBlitImage: number of layers in source and destination subresources must match";
- skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
- reinterpret_cast<uint64_t>(cb_node->commandBuffer), __LINE__, DRAWSTATE_MISMATCHED_IMAGE_ASPECT,
- "IMAGE", str);
- }
-
VkImageAspectFlags srcAspect = pRegions[i].srcSubresource.aspectMask;
VkImageAspectFlags dstAspect = pRegions[i].dstSubresource.aspectMask;
bool ValidateImageSampleCount(layer_data *dev_data, IMAGE_STATE *image_state, VkSampleCountFlagBits sample_count,
const char *location, UNIQUE_VALIDATION_ERROR_CODE msgCode);
bool ValidateImageUsageFlags(layer_data *dev_data, IMAGE_STATE const *image_state, VkFlags desired, VkBool32 strict,
- int32_t const msgCode, char const *func_name, char const *usage_string);
-
+ int32_t const msgCode, char const *func_name, char const *usage_string);
+bool ValidateImageSubrangeLevelLayerCounts(layer_data *dev_data, const VkImageSubresourceRange &subresourceRange,
+ const char *func_name, UNIQUE_VALIDATION_ERROR_CODE layer_msg_code,
+ UNIQUE_VALIDATION_ERROR_CODE level_msg_code);
// Prototypes for layer_data accessor functions. These should be in their own header file at some point
PFN_vkGetPhysicalDeviceFormatProperties GetFormatPropertiesPointer(layer_data *);
VALIDATION_ERROR_01301~^~N~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'regionCount must be greater than 0' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdBlitImage)~^~implicit
VALIDATION_ERROR_01302~^~N~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'Each of commandBuffer, dstImage, and srcImage must have been created, allocated, or retrieved from the same VkDevice' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#vkCmdBlitImage)~^~implicit
VALIDATION_ERROR_01303~^~N~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'The aspectMask member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageBlit)~^~
-VALIDATION_ERROR_01304~^~N~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'The layerCount member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageBlit)~^~
+VALIDATION_ERROR_01304~^~Y~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'The layerCount member of srcSubresource and dstSubresource must match' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageBlit)~^~
VALIDATION_ERROR_01305~^~N~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'If either of the calling commands srcImage or dstImage parameters are of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of both srcSubresource and dstSubresource must be 0 and 1, respectively' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageBlit)~^~
VALIDATION_ERROR_01306~^~N~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'The aspectMask member of srcSubresource must specify aspects present in the calling commands srcImage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageBlit)~^~
VALIDATION_ERROR_01307~^~N~^~Unknown~^~vkCmdBlitImage~^~For more information refer to Vulkan Spec Section '18.5. Image Copies with Scaling' which states 'The aspectMask member of dstSubresource must specify aspects present in the calling commands dstImage' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html#VkImageBlit)~^~