layers: allow concurrent layer device creation
authorFelix Dörre <felix@dogcraft.de>
Mon, 12 Aug 2019 18:03:47 +0000 (20:03 +0200)
committerLenny Komow <lenny@lunarg.com>
Mon, 30 Sep 2019 19:07:50 +0000 (13:07 -0600)
loader/loader.c

index 39ccc2522cb2b023de29dcce67303dad9a5acf7d..826518a75c8a2cdc71cafea4e05bf44bfa838b6f 100644 (file)
@@ -2056,7 +2056,8 @@ struct loader_icd_term *loader_get_icd_and_device(const VkDevice device, struct
             for (struct loader_device *dev = icd_term->logical_device_list; dev; dev = dev->next)
                 // Value comparison of device prevents object wrapping by layers
                 if (loader_get_dispatch(dev->icd_device) == loader_get_dispatch(device) ||
-                    loader_get_dispatch(dev->chain_device) == loader_get_dispatch(device)) {
+                    (dev->chain_device != VK_NULL_HANDLE &&
+                     loader_get_dispatch(dev->chain_device) == loader_get_dispatch(device))) {
                     *found_dev = dev;
                     if (NULL != icd_index) {
                         *icd_index = index;