From fe66808d557a1fe72f962d06610002c21479b178 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Mon, 8 Aug 2016 10:29:34 -0600 Subject: layers: In-line swapchain zero_prior_count macro Change-Id: Ib9c58f05ef045f0450f1ba62dfc7ea4498ac119e --- layers/swapchain.cpp | 20 ++++++++++++++------ layers/swapchain.h | 6 ------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp index 6b447edc..aab545be 100644 --- a/layers/swapchain.cpp +++ b/layers/swapchain.cpp @@ -1453,8 +1453,11 @@ GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR if (pPhysicalDevice->surfaceFormatCount == 0) { // Since we haven't recorded a preliminary value of *pSurfaceFormatCount, that likely means that the application didn't // previously call this function with a NULL value of pSurfaceFormats: - skipCall |= LOG_ERROR_ZERO_PRIOR_COUNT(VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, physicalDevice, - "pSurfaceFormatCount", "pSurfaceFormats"); + skipCall |= + log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, + (uint64_t)pPhysicalDevice->physicalDevice, __LINE__, SWAPCHAIN_PRIOR_COUNT, swapchain_layer_name, + "vkGetPhysicalDeviceSurfaceFormatsKHR() called with non-NULL pSurfaceFormatCount; but no prior positive " + "value has been seen for pSurfaceFormats."); } else if (*pSurfaceFormatCount > pPhysicalDevice->surfaceFormatCount) { skipCall |= log_msg( my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, @@ -1527,8 +1530,11 @@ GetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfa if (pPhysicalDevice->presentModeCount == 0) { // Since we haven't recorded a preliminary value of *pPresentModeCount, that likely means that the application didn't // previously call this function with a NULL value of pPresentModes: - skipCall |= LOG_ERROR_ZERO_PRIOR_COUNT(VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, physicalDevice, - "pPresentModeCount", "pPresentModes"); + skipCall |= + log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, + (uint64_t)pPhysicalDevice->physicalDevice, __LINE__, SWAPCHAIN_PRIOR_COUNT, swapchain_layer_name, + "vkGetPhysicalDeviceSurfacePresentModesKHR() called with non-NULL pPresentModeCount; but no prior positive " + "value has been seen for pPresentModes."); } else if (*pPresentModeCount > pPhysicalDevice->presentModeCount) { skipCall |= log_msg( my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, @@ -2025,8 +2031,10 @@ GetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwap if (pSwapchain->imageCount == 0) { // Since we haven't recorded a preliminary value of *pSwapchainImageCount, that likely means that the application didn't // previously call this function with a NULL value of pSwapchainImages: - skipCall |= LOG_ERROR_ZERO_PRIOR_COUNT(VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, device, "pSwapchainImageCount", - "pSwapchainImages"); + skipCall |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, + (uint64_t)device, __LINE__, SWAPCHAIN_PRIOR_COUNT, swapchain_layer_name, + "vkGetSwapchainImagesKHR() called with non-NULL pSwapchainImageCount; but no prior positive " + "value has been seen for pSwapchainImages."); } else if (*pSwapchainImageCount > pSwapchain->imageCount) { skipCall |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, (uint64_t)device, __LINE__, SWAPCHAIN_INVALID_COUNT, swapchain_layer_name, diff --git a/layers/swapchain.h b/layers/swapchain.h index f1717883..f0028302 100644 --- a/layers/swapchain.h +++ b/layers/swapchain.h @@ -84,12 +84,6 @@ const char * swapchain_layer_name = "Swapchain"; #define LAYER_NAME (char *) "Swapchain" -#define LOG_ERROR_ZERO_PRIOR_COUNT(objType, type, obj, obj2) \ - (my_data) ? log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (objType), (uint64_t)(obj), 0, \ - SWAPCHAIN_PRIOR_COUNT, LAYER_NAME, "%s() called with non-NULL %s; but no prior " \ - "positive value has been seen for %s.", \ - __FUNCTION__, (obj), (obj2)) \ - : VK_FALSE #define LOG_ERROR_WRONG_STYPE(objType, type, obj, val) \ (my_data) ? log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (objType), (uint64_t)(obj), 0, SWAPCHAIN_WRONG_STYPE, \ LAYER_NAME, "%s() called with the wrong value for %s->sType " \ -- cgit v1.2.3