From ebae2ff64ac09a3f4f9e4bb296d6733901386244 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Thu, 15 Dec 2016 13:15:12 -0700 Subject: [PATCH] layers: Remove redundant CreateRenderpass checks From the image layer. The check for valid attachment layouts and load/storeOps already performed in the parameter validation layer. Also removed now-dead support function and unneeded header file. Change-Id: I4f1ad1ba899a712ba21ae32e3b3e2d947b640f4d --- layers/image.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/layers/image.cpp b/layers/image.cpp index ac5284cb..ebf04ecc 100644 --- a/layers/image.cpp +++ b/layers/image.cpp @@ -40,7 +40,6 @@ #include "vk_loader_platform.h" #include "vk_dispatch_table_helper.h" #include "vk_struct_string_helper_cpp.h" -#include "vk_enum_validate_helper.h" #include "image.h" #include "vk_layer_config.h" #include "vk_layer_extension_utils.h" @@ -217,10 +216,6 @@ static const VkLayerProperties global_layer = { // Start of the Image layer proper -static inline uint32_t validate_VkImageLayoutKHR(VkImageLayout input_value) { - return ((validate_VkImageLayout(input_value) == 1) || (input_value == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR)); -} - VKAPI_ATTR VkResult VKAPI_CALL CreateImage(VkDevice device, const VkImageCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkImage *pImage) { bool skip_call = false; @@ -413,31 +408,6 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass(VkDevice device, const VkRenderP skip_call |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, IMAGE_RENDERPASS_INVALID_ATTACHMENT, "IMAGE", "%s", ss.str().c_str()); } - - if (!validate_VkImageLayoutKHR(pCreateInfo->pAttachments[i].initialLayout) || - !validate_VkImageLayoutKHR(pCreateInfo->pAttachments[i].finalLayout)) { - std::stringstream ss; - ss << "vkCreateRenderPass parameter, VkImageLayout in pCreateInfo->pAttachments[" << i << "], is unrecognized"; - // TODO: Verify against Valid Use section of spec. Generally if something yield an undefined result, it's invalid - skip_call |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, - IMAGE_RENDERPASS_INVALID_ATTACHMENT, "IMAGE", "%s", ss.str().c_str()); - } - - if (!validate_VkAttachmentLoadOp(pCreateInfo->pAttachments[i].loadOp)) { - std::stringstream ss; - ss << "vkCreateRenderPass parameter, VkAttachmentLoadOp in pCreateInfo->pAttachments[" << i << "], is unrecognized"; - // TODO: Verify against Valid Use section of spec. Generally if something yield an undefined result, it's invalid - skip_call |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, - IMAGE_RENDERPASS_INVALID_ATTACHMENT, "IMAGE", "%s", ss.str().c_str()); - } - - if (!validate_VkAttachmentStoreOp(pCreateInfo->pAttachments[i].storeOp)) { - std::stringstream ss; - ss << "vkCreateRenderPass parameter, VkAttachmentStoreOp in pCreateInfo->pAttachments[" << i << "], is unrecognized"; - // TODO: Verify against Valid Use section of spec. Generally if something yield an undefined result, it's invalid - skip_call |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, - IMAGE_RENDERPASS_INVALID_ATTACHMENT, "IMAGE", "%s", ss.str().c_str()); - } } if (skip_call) { -- 2.34.1