skip |= ValidateImageUsageFlags(
device_data, image_state,
VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT |
- VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
+ VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
false, -1, "vkCreateImageView()",
"VK_IMAGE_USAGE_[SAMPLED|STORAGE|COLOR_ATTACHMENT|DEPTH_STENCIL_ATTACHMENT|INPUT_ATTACHMENT]_BIT");
// If this isn't a sparse image, it needs to have memory backing it at CreateImageView time
skip |= ValidateMemoryIsBoundToImage(device_data, image_state, "vkCreateImageView()", VALIDATION_ERROR_0ac007f8);
// Checks imported from image layer
skip |= ValidateImageSubresourceRange(device_data, image_state, create_info->viewType == VK_IMAGE_VIEW_TYPE_2D_ARRAY,
- create_info->subresourceRange, "vkCreateImageView", "pCreateInfo->subresourceRange");
+ create_info->subresourceRange, "vkCreateImageView", "pCreateInfo->subresourceRange");
VkImageCreateFlags image_flags = image_state->createInfo.flags;
VkFormat image_format = image_state->createInfo.format;
VkFormat view_format = create_info->format;
VkImageAspectFlags aspect_mask = create_info->subresourceRange.aspectMask;
+ VkImageType image_type = image_state->createInfo.imageType;
+ VkImageViewType view_type = create_info->viewType;
// Validate VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT state
if (image_flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) {
// Validate correct image aspect bits for desired formats and format consistency
skip |= ValidateImageAspectMask(device_data, image_state->image, image_format, aspect_mask, "vkCreateImageView()");
+
+ switch (image_type) {
+ case VK_IMAGE_TYPE_1D:
+ if (view_type != VK_IMAGE_VIEW_TYPE_1D && view_type != VK_IMAGE_VIEW_TYPE_1D_ARRAY) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_0ac007fa, "IMAGE",
+ "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s. %s",
+ string_VkImageViewType(view_type), string_VkImageType(image_type),
+ validation_error_map[VALIDATION_ERROR_0ac007fa]);
+ }
+ break;
+ case VK_IMAGE_TYPE_2D:
+ if (view_type != VK_IMAGE_VIEW_TYPE_2D && view_type != VK_IMAGE_VIEW_TYPE_2D_ARRAY) {
+ if ((view_type == VK_IMAGE_VIEW_TYPE_CUBE || view_type == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY) &&
+ !(image_flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT)) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_0ac007d6, "IMAGE",
+ "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s. %s",
+ string_VkImageViewType(view_type), string_VkImageType(image_type),
+ validation_error_map[VALIDATION_ERROR_0ac007d6]);
+ } else if (view_type != VK_IMAGE_VIEW_TYPE_CUBE && view_type != VK_IMAGE_VIEW_TYPE_CUBE_ARRAY) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_0ac007fa, "IMAGE",
+ "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s. %s",
+ string_VkImageViewType(view_type), string_VkImageType(image_type),
+ validation_error_map[VALIDATION_ERROR_0ac007fa]);
+ }
+ }
+ break;
+ case VK_IMAGE_TYPE_3D:
+ if (GetDeviceExtensions(device_data)->vk_khr_maintenance1) {
+ if (view_type != VK_IMAGE_VIEW_TYPE_3D) {
+ if ((view_type == VK_IMAGE_VIEW_TYPE_2D || view_type == VK_IMAGE_VIEW_TYPE_2D_ARRAY)) {
+ if (!(image_flags & VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR)) {
+ skip |= log_msg(
+ report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_0ac007da, "IMAGE",
+ "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s. %s",
+ string_VkImageViewType(view_type), string_VkImageType(image_type),
+ validation_error_map[VALIDATION_ERROR_0ac007da]);
+ } else if ((image_flags & (VK_IMAGE_CREATE_SPARSE_BINDING_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT |
+ VK_IMAGE_CREATE_SPARSE_ALIASED_BIT))) {
+ skip |= log_msg(
+ report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_0ac007fa, "IMAGE",
+ "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s when the "
+ "VK_IMAGE_CREATE_SPARSE_BINDING_BIT, VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, or "
+ "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT flags are enabled. %s",
+ string_VkImageViewType(view_type), string_VkImageType(image_type),
+ validation_error_map[VALIDATION_ERROR_0ac007fa]);
+ }
+ } else {
+ skip |=
+ log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_0ac007fa, "IMAGE",
+ "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s. %s",
+ string_VkImageViewType(view_type), string_VkImageType(image_type),
+ validation_error_map[VALIDATION_ERROR_0ac007fa]);
+ }
+ }
+ } else {
+ if (view_type != VK_IMAGE_VIEW_TYPE_3D) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_0ac007fa, "IMAGE",
+ "vkCreateImageView(): pCreateInfo->viewType %s is not compatible with image type %s. %s",
+ string_VkImageViewType(view_type), string_VkImageType(image_type),
+ validation_error_map[VALIDATION_ERROR_0ac007fa]);
+ }
+ }
+ break;
+ default:
+ break;
+ }
}
return skip;
}
VALIDATION_ERROR_0aa007c6~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageSwapchainCreateInfoKHX-swapchain-00995~^~core~^~The spec valid usage text states 'If swapchain is not VK_NULL_HANDLE, the fields of VkImageCreateInfo must match the implied image creation parameters of the swapchain' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSwapchainCreateInfoKHX-swapchain-00995)~^~
VALIDATION_ERROR_0aa2b00b~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageSwapchainCreateInfoKHX-sType-sType~^~core~^~The spec valid usage text states 'sType must be VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHX' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSwapchainCreateInfoKHX-sType-sType)~^~implicit
VALIDATION_ERROR_0aa2f001~^~N~^~Unknown~^~vkCreateImage~^~VUID-VkImageSwapchainCreateInfoKHX-swapchain-parameter~^~core~^~The spec valid usage text states 'If swapchain is not VK_NULL_HANDLE, swapchain must be a valid VkSwapchainKHR handle' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageSwapchainCreateInfoKHX-swapchain-parameter)~^~implicit
-VALIDATION_ERROR_0ac007d6~^~N~^~Unknown~^~vkCreateImageView~^~VUID-VkImageViewCreateInfo-image-01003~^~core~^~The spec valid usage text states 'If image was not created with VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT then viewType must not be VK_IMAGE_VIEW_TYPE_CUBE or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01003)~^~
+VALIDATION_ERROR_0ac007d6~^~Y~^~CreateImageViewBreaksParameterCompatibilityRequirements~^~vkCreateImageView~^~VUID-VkImageViewCreateInfo-image-01003~^~core~^~The spec valid usage text states 'If image was not created with VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT then viewType must not be VK_IMAGE_VIEW_TYPE_CUBE or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01003)~^~
VALIDATION_ERROR_0ac007d8~^~N~^~Unknown~^~vkCreateImageView~^~VUID-VkImageViewCreateInfo-viewType-01004~^~core~^~The spec valid usage text states 'If the image cubemap arrays feature is not enabled, viewType must not be VK_IMAGE_VIEW_TYPE_CUBE_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-viewType-01004)~^~
-VALIDATION_ERROR_0ac007da~^~N~^~Unknown~^~vkCreateImageView~^~VUID-VkImageViewCreateInfo-image-01005~^~(VK_KHR_maintenance1)~^~The spec valid usage text states 'If image was created with VK_IMAGE_TYPE_3D but without VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR set then viewType must not be VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01005)~^~
+VALIDATION_ERROR_0ac007da~^~Y~^~CreateImageViewBreaksParameterCompatibilityRequirements~^~vkCreateImageView~^~VUID-VkImageViewCreateInfo-image-01005~^~(VK_KHR_maintenance1)~^~The spec valid usage text states 'If image was created with VK_IMAGE_TYPE_3D but without VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR set then viewType must not be VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01005)~^~
VALIDATION_ERROR_0ac007dc~^~N~^~Unknown~^~vkCreateImageView~^~VUID-VkImageViewCreateInfo-image-01006~^~core~^~The spec valid usage text states 'If image was created with VK_IMAGE_TILING_LINEAR, format must be format that has at least one supported feature bit present in the value of VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01006)~^~
VALIDATION_ERROR_0ac007de~^~N~^~Unknown~^~vkCreateImageView~^~VUID-VkImageViewCreateInfo-image-01007~^~core~^~The spec valid usage text states 'image must have been created with a usage value containing at least one of VK_IMAGE_USAGE_SAMPLED_BIT, VK_IMAGE_USAGE_STORAGE_BIT, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01007)~^~
VALIDATION_ERROR_0ac007e0~^~N~^~Unknown~^~vkCreateImageView~^~VUID-VkImageViewCreateInfo-image-01008~^~core~^~The spec valid usage text states 'If image was created with VK_IMAGE_TILING_LINEAR and usage contains VK_IMAGE_USAGE_SAMPLED_BIT, format must be supported for sampled images, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT flag in VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01008)~^~
VALIDATION_ERROR_0ac007f4~^~Y~^~CreateImageViewDifferentClass~^~vkCreateImageView~^~VUID-VkImageViewCreateInfo-image-01018~^~core~^~The spec valid usage text states 'If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, format must be compatible with the format used to create image, as defined in Format Compatibility Classes' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01018)~^~Multi-purposing this for some format compatibility checks, need unique enums.
VALIDATION_ERROR_0ac007f6~^~Y~^~CreateImageViewNoMutableFormatBit~^~vkCreateImageView~^~VUID-VkImageViewCreateInfo-image-01019~^~core~^~The spec valid usage text states 'If image was not created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, format must be identical to the format used to create image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01019)~^~
VALIDATION_ERROR_0ac007f8~^~Y~^~Unknown~^~vkCreateImageView~^~VUID-VkImageViewCreateInfo-image-01020~^~core~^~The spec valid usage text states 'If image is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01020)~^~
-VALIDATION_ERROR_0ac007fa~^~N~^~Unknown~^~vkCreateImageView~^~VUID-VkImageViewCreateInfo-subResourceRange-01021~^~core~^~The spec valid usage text states 'subresourceRange and viewType must be compatible with the image, as described in the compatibility table' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subResourceRange-01021)~^~
+VALIDATION_ERROR_0ac007fa~^~Y~^~CreateImageViewBreaksParameterCompatibilityRequirements~^~vkCreateImageView~^~VUID-VkImageViewCreateInfo-subResourceRange-01021~^~core~^~The spec valid usage text states 'subresourceRange and viewType must be compatible with the image, as described in the compatibility table' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subResourceRange-01021)~^~
VALIDATION_ERROR_0ac00b8c~^~N~^~None~^~VkImageViewCreateInfo~^~VUID-VkImageViewCreateInfo-subresourceRange-01478~^~core~^~The spec valid usage text states 'subresourceRange::baseMipLevel must be less than the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01478)~^~
VALIDATION_ERROR_0ac00b8e~^~N~^~None~^~VkImageViewCreateInfo~^~VUID-VkImageViewCreateInfo-subresourceRange-01479~^~core~^~The spec valid usage text states 'If subresourceRange::levelCount is not VK_REMAINING_MIP_LEVELS, subresourceRange::levelCount must be non-zero and subresourceRange::baseMipLevel + subresourceRange::levelCount must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01479)~^~
VALIDATION_ERROR_0ac00b90~^~N~^~None~^~VkImageViewCreateInfo~^~VUID-VkImageViewCreateInfo-subresourceRange-01480~^~!(VK_KHR_maintenance1)~^~The spec valid usage text states 'subresourceRange::baseArrayLayer must be less than the arrayLayers specified in VkImageCreateInfo when image was created' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageViewCreateInfo-subresourceRange-01480)~^~