diff options
| author | Chris Forbes <chrisforbes@google.com> | 2016-10-12 15:00:46 +1300 |
|---|---|---|
| committer | Chris Forbes <chrisforbes@google.com> | 2016-11-22 11:45:12 +1300 |
| commit | 83cfc0cfc82a0fb08490d4f564f7e4fce16c1e80 (patch) | |
| tree | b11d22a568b91266b0b783bfc79d0c78be6702b4 | |
| parent | 999ae8b0f494e9d934233b965bd5959c5fec1816 (diff) | |
| download | usermoji-83cfc0cfc82a0fb08490d4f564f7e4fce16c1e80.tar.xz | |
layers: Remove husk of capabilities tracking from swapchain
Signed-off-by: Chris Forbes <chrisforbes@google.com>
| -rw-r--r-- | layers/swapchain.cpp | 46 | ||||
| -rw-r--r-- | layers/swapchain.h | 6 |
2 files changed, 1 insertions, 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<std::mutex> 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<PFN_vkVoidFunction>(DestroySurfaceKHR)}, {"vkGetPhysicalDeviceSurfaceSupportKHR", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceSupportKHR)}, - {"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", - reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceCapabilitiesKHR)}, {"vkGetPhysicalDeviceSurfaceFormatsKHR", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfaceFormatsKHR)}, {"vkGetPhysicalDeviceSurfacePresentModesKHR", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfacePresentModesKHR)}, diff --git a/layers/swapchain.h b/layers/swapchain.h index 0a586d76..a826534e 100644 --- a/layers/swapchain.h +++ b/layers/swapchain.h @@ -148,12 +148,6 @@ struct SwpPhysicalDevice { // 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(): uint32_t surfaceFormatCount; VkSurfaceFormatKHR *pSurfaceFormats; |
