From: Jeremy Hayes Date: Tue, 1 Mar 2016 21:01:45 +0000 (-0700) Subject: layers: gllavl#76 validate initialLayout X-Git-Tag: submit/tizen/20181227.054638~3687 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad4ead6be633f9fbe3e7c9da0aac8efad4a9dca0;p=platform%2Fupstream%2FVulkan-Tools.git layers: gllavl#76 validate initialLayout Change-Id: Iede6dcf3bc83a5663b80b62c3239ef54bc74278a --- diff --git a/layers/image.cpp b/layers/image.cpp index 0f3fae97..5f354502 100644 --- a/layers/image.cpp +++ b/layers/image.cpp @@ -417,6 +417,15 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(VkDevice device, co string_VkSampleCountFlagBits(pCreateInfo->samples), ImageFormatProperties.sampleCounts); } + if (pCreateInfo->initialLayout != VK_IMAGE_LAYOUT_UNDEFINED || + pCreateInfo->initialLayout != VK_IMAGE_LAYOUT_PREINITIALIZED) + { + skipCall |= log_msg(phy_dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, + (uint64_t)pImage, __LINE__, IMAGE_INVALID_LAYOUT, "Image", + "vkCreateImage parameter, pCreateInfo->initialLayout, must be VK_IMAGE_LAYOUT_UNDEFINED or " + "VK_IMAGE_LAYOUT_PREINITIALIZED"); + } + if (VK_FALSE == skipCall) { result = device_data->device_dispatch_table->CreateImage(device, pCreateInfo, pAllocator, pImage); } diff --git a/layers/image.h b/layers/image.h index 350a3beb..3ee3500a 100644 --- a/layers/image.h +++ b/layers/image.h @@ -49,6 +49,7 @@ typedef enum _IMAGE_ERROR IMAGE_INVALID_FILTER, // Operation specifies an invalid filter setting IMAGE_INVALID_IMAGE_RESOURCE, // Image resource/subresource called with invalid setting IMAGE_INVALID_FORMAT_LIMITS_VIOLATION, // Device limits for this format have been exceeded + IMAGE_INVALID_LAYOUT, // Operation specifies an invalid layout. } IMAGE_ERROR; typedef struct _IMAGE_STATE