aboutsummaryrefslogtreecommitdiff
path: root/layers/multi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layers/multi.cpp')
-rw-r--r--layers/multi.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/layers/multi.cpp b/layers/multi.cpp
index 910bc5bb..c5906203 100644
--- a/layers/multi.cpp
+++ b/layers/multi.cpp
@@ -283,6 +283,60 @@ VK_LAYER_EXPORT VkResult VKAPI vkEnumerateLayers(VkPhysicalGpu gpu, size_t maxLa
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;