From 83cfc0cfc82a0fb08490d4f564f7e4fce16c1e80 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 12 Oct 2016 15:00:46 +1300 Subject: layers: Remove husk of capabilities tracking from swapchain Signed-off-by: Chris Forbes --- layers/swapchain.cpp | 46 +--------------------------------------------- layers/swapchain.h | 6 ------ 2 files changed, 1 insertion(+), 51 deletions(-) diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp index 07202283..6a868708 100644 --- a/layers/swapchain.cpp +++ b/layers/swapchain.cpp @@ -853,7 +853,6 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices(VkInstance instance, uin my_data->physicalDeviceMap[pPhysicalDevices[i]].pInstance = pInstance; my_data->physicalDeviceMap[pPhysicalDevices[i]].pDevice = NULL; my_data->physicalDeviceMap[pPhysicalDevices[i]].gotQueueFamilyPropertyCount = false; - my_data->physicalDeviceMap[pPhysicalDevices[i]].gotSurfaceCapabilities = false; my_data->physicalDeviceMap[pPhysicalDevices[i]].surfaceFormatCount = 0; my_data->physicalDeviceMap[pPhysicalDevices[i]].pSurfaceFormats = NULL; my_data->physicalDeviceMap[pPhysicalDevices[i]].presentModeCount = 0; @@ -1007,43 +1006,6 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevi return VK_ERROR_VALIDATION_FAILED_EXT; } -VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, - VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) { - VkResult result = VK_SUCCESS; - bool skip_call = false; - layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); - std::unique_lock lock(global_lock); - SwpPhysicalDevice *pPhysicalDevice = NULL; - { - auto it = my_data->physicalDeviceMap.find(physicalDevice); - pPhysicalDevice = (it == my_data->physicalDeviceMap.end()) ? NULL : &it->second; - } - - lock.unlock(); - - if (!skip_call) { - // Call down the call chain: - result = my_data->instance_dispatch_table->GetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, surface, - pSurfaceCapabilities); - lock.lock(); - - // Obtain this pointer again after locking: - { - auto it = my_data->physicalDeviceMap.find(physicalDevice); - pPhysicalDevice = (it == my_data->physicalDeviceMap.end()) ? NULL : &it->second; - } - if ((result == VK_SUCCESS) && pPhysicalDevice) { - // Record the result of this query: - pPhysicalDevice->gotSurfaceCapabilities = true; - pPhysicalDevice->surfaceCapabilities = *pSurfaceCapabilities; - } - lock.unlock(); - - return result; - } - return VK_ERROR_VALIDATION_FAILED_EXT; -} - VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats) { @@ -1218,11 +1180,7 @@ static bool validateCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateI } } - // Validate pCreateInfo values with the results of - // vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): - if (!pPhysicalDevice || !pPhysicalDevice->gotSurfaceCapabilities) { - // Check moved to CV - } else if (pCreateInfo) { + if (pCreateInfo) { // Validate pCreateInfo->surface to make sure that // vkGetPhysicalDeviceSurfaceSupportKHR() reported this as a supported // surface: @@ -1732,8 +1690,6 @@ static PFN_vkVoidFunction intercept_khr_surface_command(const char *name, VkInst #endif // VK_USE_PLATFORM_XLIB_KHR {"vkDestroySurfaceKHR", reinterpret_cast(DestroySurfaceKHR)}, {"vkGetPhysicalDeviceSurfaceSupportKHR", reinterpret_cast(GetPhysicalDeviceSurfaceSupportKHR)}, - {"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", - reinterpret_cast(GetPhysicalDeviceSurfaceCapabilitiesKHR)}, {"vkGetPhysicalDeviceSurfaceFormatsKHR", reinterpret_cast(GetPhysicalDeviceSurfaceFormatsKHR)}, {"vkGetPhysicalDeviceSurfacePresentModesKHR", reinterpret_cast(GetPhysicalDeviceSurfacePresentModesKHR)}, diff --git a/layers/swapchain.h b/layers/swapchain.h index 0a586d76..a826534e 100644 --- a/layers/swapchain.h +++ b/layers/swapchain.h @@ -146,12 +146,6 @@ struct SwpPhysicalDevice { // called for: unordered_map supportedSurfaces; - // TODO: Record/use this info per-surface, not per-device, once a - // non-dispatchable surface object is added to WSI: - // Results of vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): - bool gotSurfaceCapabilities; - VkSurfaceCapabilitiesKHR surfaceCapabilities; - // TODO: Record/use this info per-surface, not per-device, once a // non-dispatchable surface object is added to WSI: // Count and VkSurfaceFormatKHR's returned by vkGetPhysicalDeviceSurfaceFormatsKHR(): -- cgit v1.2.3