layers: Remove bogus CreateSharedSwapchainsKHR impl in swapchain
authorChris Forbes <chrisforbes@google.com>
Mon, 28 Nov 2016 02:25:34 +0000 (15:25 +1300)
committerChris Forbes <chrisforbes@google.com>
Mon, 28 Nov 2016 19:28:33 +0000 (08:28 +1300)
This wasn't even wired up. Parameter validation also now does these
checks.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
layers/swapchain.cpp

index bf42b53..6ae123a 100644 (file)
@@ -1429,52 +1429,6 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainImagesKHR(VkDevice device, VkSwapchai
     return VK_ERROR_VALIDATION_FAILED_EXT;
 }
 
-VKAPI_ATTR VkResult VKAPI_CALL CreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount,
-                                                         const VkSwapchainCreateInfoKHR *pCreateInfos,
-                                                         const VkAllocationCallbacks *pAllocator, VkSwapchainKHR *pSwapchains) {
-    VkResult result = VK_SUCCESS;
-    bool skip_call = false;
-    layer_data *my_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
-    std::unique_lock<std::mutex> lock(global_lock);
-
-    if (!pCreateInfos || !pSwapchains) {
-        skip_call |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
-                             reinterpret_cast<uint64_t>(device), __LINE__, SWAPCHAIN_NULL_POINTER, swapchain_layer_name,
-                             "vkCreateSharedSwapchainsKHR() called with NULL pointer");
-    }
-    if (swapchainCount == 0) {
-        skip_call |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
-                             reinterpret_cast<uint64_t>(device), __LINE__, SWAPCHAIN_INVALID_COUNT, swapchain_layer_name,
-                             "vkCreateSharedSwapchainsKHR() called with invalid swapchain count of %d.", swapchainCount);
-    } else {
-        SwpSwapchain *pSwapchain = nullptr;
-        for (uint32_t iii = 0; iii < swapchainCount; iii++) {
-            if (pCreateInfos[iii].sType != VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR) {
-                skip_call |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
-                                     reinterpret_cast<uint64_t>(device), __LINE__, SWAPCHAIN_WRONG_STYPE, swapchain_layer_name,
-                                     "vkCreateSharedSwapchainsKHR() called with invalid stype in pCreateInfos[%d].", iii);
-            }
-            auto it = my_data->swapchainMap.find(pSwapchains[iii]);
-            pSwapchain = (it == my_data->swapchainMap.end()) ? nullptr : &it->second;
-            if (nullptr == pSwapchain) {
-                skip_call |=
-                    log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
-                            reinterpret_cast<uint64_t>(device), __LINE__, SWAPCHAIN_INVALID_HANDLE, swapchain_layer_name,
-                            "vkCreateSharedSwapchainsKHR() called with invalid Swapchain Handle in pCreateInfos[%d].", iii);
-            }
-        }
-    }
-    lock.unlock();
-
-    if (!skip_call) {
-        // Call down the call chain:
-        result = my_data->device_dispatch_table->CreateSharedSwapchainsKHR(device, swapchainCount, pCreateInfos, pAllocator,
-                                                                           pSwapchains);
-        return result;
-    }
-    return VK_ERROR_VALIDATION_FAILED_EXT;
-}
-
 VKAPI_ATTR void VKAPI_CALL
 GetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue *pQueue) {
     bool skip_call = false;