From fe543f83a6dc9f2bbded8e30eb2afea8ba6c6038 Mon Sep 17 00:00:00 2001 From: Mike Weiblen Date: Fri, 9 Dec 2016 17:36:28 -0700 Subject: layers: Update Valid Usage enums (VL-70) Reviewed the following 5 files' invocation of log_msg() for opportunities to update for Valid Usage enums. layers/threading.h layers/vk_layer_logging.h layers/descriptor_sets.cpp layers/swapchain.cpp layers/unique_objects.cpp Split some composite checks apart, to better match the meaning of individual VUs. Added VU enums to a new file, and expanded the stats collection script to include the new file. Changed some placeholder uses of msgCode=="0" to "VALIDATION_ERROR_UNDEFINED". (0 is the value of the enum VALIDATION_ERROR_00000 which was misleading) When Valid Usage enums were referenced, also updated the VU database. Tweak #include order for Windows, to undo clang-format reordering. Completes Jira task VL-70. Change-Id: I550922b194e733f41316ae493098f70a54cbd64e --- layers/unique_objects.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'layers/unique_objects.cpp') diff --git a/layers/unique_objects.cpp b/layers/unique_objects.cpp index d4aabdfe..bd9aabd8 100644 --- a/layers/unique_objects.cpp +++ b/layers/unique_objects.cpp @@ -28,18 +28,21 @@ #include #include +// For Windows, this #include must come before other Vk headers. #include "vk_loader_platform.h" -#include "vulkan/vk_layer.h" -#include "vk_layer_config.h" -#include "vk_layer_extension_utils.h" -#include "vk_layer_utils.h" -#include "vk_layer_table.h" -#include "vk_layer_logging.h" + #include "unique_objects.h" #include "vk_dispatch_table_helper.h" -#include "vk_struct_string_helper_cpp.h" +#include "vk_layer_config.h" #include "vk_layer_data.h" +#include "vk_layer_extension_utils.h" +#include "vk_layer_logging.h" +#include "vk_layer_table.h" #include "vk_layer_utils.h" +#include "vk_layer_utils.h" +#include "vk_struct_string_helper_cpp.h" +#include "vk_validation_error_messages.h" +#include "vulkan/vk_layer.h" // This intentionally includes a cpp file #include "vk_safe_struct.cpp" @@ -101,7 +104,7 @@ static void checkInstanceRegisterExtensions(const VkInstanceCreateInfo *pCreateI layer_data *instance_data = get_my_data_ptr(get_dispatch_key(instance), layer_data_map); if (!white_list(pCreateInfo->ppEnabledExtensionNames[i], kUniqueObjectsSupportedInstanceExtensions)) { log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - 0, "UniqueObjects", + VALIDATION_ERROR_UNDEFINED, "UniqueObjects", "Instance Extension %s is not supported by this layer. Using this extension may adversely affect " "validation results and/or produce undefined behavior.", pCreateInfo->ppEnabledExtensionNames[i]); @@ -129,7 +132,7 @@ static void createDeviceRegisterExtensions(const VkDeviceCreateInfo *pCreateInfo // Check for recognized device extensions if (!white_list(pCreateInfo->ppEnabledExtensionNames[i], kUniqueObjectsSupportedDeviceExtensions)) { log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, - 0, "UniqueObjects", + VALIDATION_ERROR_UNDEFINED, "UniqueObjects", "Device Extension %s is not supported by this layer. Using this extension may adversely affect " "validation results and/or produce undefined behavior.", pCreateInfo->ppEnabledExtensionNames[i]); -- cgit v1.2.3