layers: Remove dead device queue tracking from swapchain
authorChris Forbes <chrisforbes@google.com>
Thu, 1 Jun 2017 18:37:58 +0000 (11:37 -0700)
committerChris Forbes <chrisf@ijw.co.nz>
Mon, 5 Jun 2017 18:56:37 +0000 (11:56 -0700)
layers/core_validation.cpp
layers/swapchain.cpp
layers/swapchain.h

index 0c7a336..e28caff 100644 (file)
@@ -10386,7 +10386,6 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainImagesKHR(VkDevice device, VkSwapchai
         // This should never happen and is checked by param checker.
         if (!pCount) return result;
         std::lock_guard<std::mutex> lock(global_lock);
-        const size_t count = *pCount;
         auto swapchain_node = GetSwapchainNode(dev_data, swapchain);
         for (uint32_t i = 0; i < *pCount; ++i) {
             IMAGE_LAYOUT_NODE image_layout_node;
index 4bff594..308276d 100644 (file)
@@ -875,30 +875,6 @@ VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainImagesKHR(VkDevice device, VkSwapchai
     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;
-    layer_data *my_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
-
-    if (!skip_call) {
-        // Call down the call chain:
-        my_data->device_dispatch_table->GetDeviceQueue(device, queueFamilyIndex, queueIndex, pQueue);
-
-        // Remember the queue's handle, and link it to the device:
-        std::lock_guard<std::mutex> lock(global_lock);
-        SwpDevice *pDevice = NULL;
-        {
-            auto it = my_data->deviceMap.find(device);
-            pDevice = (it == my_data->deviceMap.end()) ? NULL : &it->second;
-        }
-        my_data->queueMap[&pQueue].queue = *pQueue;
-        if (pDevice) {
-            pDevice->queues[*pQueue] = &my_data->queueMap[*pQueue];
-        }
-        my_data->queueMap[&pQueue].pDevice = pDevice;
-        my_data->queueMap[&pQueue].queueFamilyIndex = queueFamilyIndex;
-    }
-}
-
 VKAPI_ATTR VkResult VKAPI_CALL CreateDebugReportCallbackEXT(VkInstance instance,
                                                             const VkDebugReportCallbackCreateInfoEXT *pCreateInfo,
                                                             const VkAllocationCallbacks *pAllocator,
@@ -1093,7 +1069,6 @@ static PFN_vkVoidFunction intercept_core_device_command(const char *name) {
     } core_device_commands[] = {
         {"vkGetDeviceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceProcAddr)},
         {"vkDestroyDevice", reinterpret_cast<PFN_vkVoidFunction>(DestroyDevice)},
-        {"vkGetDeviceQueue", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceQueue)},
     };
 
     for (size_t i = 0; i < ARRAY_SIZE(core_device_commands); i++) {
index 0bb5791..5949a3f 100644 (file)
@@ -137,9 +137,6 @@ struct SwpDevice {
     // When vkCreateSwapchainKHR is called, the VkSwapchainKHR's are
     // remembered:
     std::unordered_map<VkSwapchainKHR, SwpSwapchain *> swapchains;
-
-    // When vkGetDeviceQueue is called, the VkQueue's are remembered:
-    std::unordered_map<VkQueue, SwpQueue *> queues;
 };
 
 // Create one of these for each VkImage within a VkSwapchainKHR: