vulkan: Add vkGetGlobalExtensionInfo entrypoint

have loader use it to enumerate all extensions from layers and drivers.
Non-gode_gen layers also updated to include vkGetGlobalExtensionInfo

Includes verion info as part of GetExtensionSupport return data.

TODO: vk-layer-generate needs work

v2: do not check for non-existing ENABLE_WSI_X11 (olv)
diff --git a/layers/multi.cpp b/layers/multi.cpp
index 910bc5b..c590620 100644
--- a/layers/multi.cpp
+++ b/layers/multi.cpp
@@ -283,6 +283,60 @@
     return VK_SUCCESS;
 }
 
+struct extProps {
+    uint32_t version;
+    const char * const name;
+};
+
+#define MULTI_LAYER_EXT_ARRAY_SIZE 2
+static const struct extProps multiExts[MULTI_LAYER_EXT_ARRAY_SIZE] = {
+    // TODO what is the version?
+    0x10, "multi1",
+    0x10, "multi2",
+};
+
+VK_LAYER_EXPORT VkResult VKAPI vkGetGlobalExtensionInfo(
+                                               VkExtensionInfoType infoType,
+                                               uint32_t extensionIndex,
+                                               size_t*  pDataSize,
+                                               void*    pData)
+{
+    VkResult result;
+
+    /* This entrypoint is NOT going to init it's own dispatch table since loader calls here early */
+    VkExtensionProperties *ext_props;
+    uint32_t *count;
+
+    if (pDataSize == NULL)
+        return VK_ERROR_INVALID_POINTER;
+
+    switch (infoType) {
+        case VK_EXTENSION_INFO_TYPE_COUNT:
+            *pDataSize = sizeof(uint32_t);
+            if (pData == NULL)
+                return VK_SUCCESS;
+            count = (uint32_t *) pData;
+            *count = MULTI_LAYER_EXT_ARRAY_SIZE;
+            break;
+        case VK_EXTENSION_INFO_TYPE_PROPERTIES:
+            *pDataSize = sizeof(VkExtensionProperties);
+            if (pData == NULL)
+                return VK_SUCCESS;
+            if (extensionIndex >= MULTI_LAYER_EXT_ARRAY_SIZE)
+                return VK_ERROR_INVALID_VALUE;
+            ext_props = (VkExtensionProperties *) pData;
+            ext_props->version = multiExts[extensionIndex].version;
+            strncpy(ext_props->extName, multiExts[extensionIndex].name,
+                                        VK_MAX_EXTENSION_NAME);
+            ext_props->extName[VK_MAX_EXTENSION_NAME - 1] = '\0';
+            break;
+        default:
+            return VK_ERROR_INVALID_VALUE;
+    };
+
+    return VK_SUCCESS;
+}
+
 VK_LAYER_EXPORT VkResult VKAPI vkGetExtensionSupport(VkPhysicalGpu gpu, const char* pExtName)
 {
     VkResult result;