From e73177d8c7f25ef291b9a5ece81de4e111a03af1 Mon Sep 17 00:00:00 2001 From: Jan-Harald Fredriksen Date: Wed, 8 Jun 2016 18:51:52 +0200 Subject: layers: PR632, Change devlimits errors to warnings Replace call sequence errors with warnings for vkEnumeratePhysicalDevices and GetPhysicalDeviceQueueFamilyProperties. Change-Id: I1505f4a2b339ac7ef435da8b3ec2f85612026a42 --- layers/device_limits.cpp | 17 +++++++++-------- layers/device_limits.h | 1 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/layers/device_limits.cpp b/layers/device_limits.cpp index 374911b4..36d3d569 100644 --- a/layers/device_limits.cpp +++ b/layers/device_limits.cpp @@ -166,15 +166,16 @@ EnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, Vk my_data->instanceState->vkEnumeratePhysicalDevicesState = QUERY_COUNT; } else { if (UNCALLED == my_data->instanceState->vkEnumeratePhysicalDevicesState) { - // Flag error here, shouldn't be calling this without having queried count + // Flag warning here. You can call this without having queried the count, but it may not be + // robust on platforms with multiple physical devices. skipCall |= - log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, 0, - __LINE__, DEVLIMITS_MUST_QUERY_COUNT, "DL", - "Invalid call sequence to vkEnumeratePhysicalDevices() w/ non-NULL pPhysicalDevices. You should first " + log_msg(my_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, 0, + __LINE__, DEVLIMITS_MISSING_QUERY_COUNT, "DL", + "Call sequence has vkEnumeratePhysicalDevices() w/ non-NULL pPhysicalDevices. You should first " "call vkEnumeratePhysicalDevices() w/ NULL pPhysicalDevices to query pPhysicalDeviceCount."); } // TODO : Could also flag a warning if re-calling this function in QUERY_DETAILS state else if (my_data->instanceState->physicalDevicesCount != *pPhysicalDeviceCount) { - // TODO: Having actual count match count from app is not a requirement, so this can be a warning + // Having actual count match count from app is not a requirement, so this can be a warning skipCall |= log_msg(my_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_COUNT_MISMATCH, "DL", "Call to vkEnumeratePhysicalDevices() w/ pPhysicalDeviceCount value %u, but actual count " @@ -247,9 +248,9 @@ GetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t // Verify that for each physical device, this function is called first with NULL pQueueFamilyProperties ptr in order to // get count if (UNCALLED == phy_dev_data->physicalDeviceState->vkGetPhysicalDeviceQueueFamilyPropertiesState) { - skipCall |= log_msg(phy_dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_MUST_QUERY_COUNT, "DL", - "Invalid call sequence to vkGetPhysicalDeviceQueueFamilyProperties() w/ non-NULL " + skipCall |= log_msg(phy_dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_MISSING_QUERY_COUNT, "DL", + "Call sequence has vkGetPhysicalDeviceQueueFamilyProperties() w/ non-NULL " "pQueueFamilyProperties. You should first call vkGetPhysicalDeviceQueueFamilyProperties() w/ " "NULL pQueueFamilyProperties to query pCount."); } diff --git a/layers/device_limits.h b/layers/device_limits.h index bec9dce1..5aa54483 100644 --- a/layers/device_limits.h +++ b/layers/device_limits.h @@ -30,6 +30,7 @@ enum DEV_LIMITS_ERROR { DEVLIMITS_INVALID_PHYSICAL_DEVICE, // Invalid physical device used DEVLIMITS_INVALID_INHERITED_QUERY, // Invalid use of inherited query DEVLIMITS_INVALID_ATTACHMENT_COUNT, // Invalid value for the number of attachments + DEVLIMITS_MISSING_QUERY_COUNT, // Did not make initial call to an API to query the count DEVLIMITS_MUST_QUERY_COUNT, // Failed to make initial call to an API to query the count DEVLIMITS_INVALID_CALL_SEQUENCE, // Flag generic case of an invalid call sequence by the app DEVLIMITS_INVALID_FEATURE_REQUESTED, // App requested a feature not supported by physical device -- cgit v1.2.3