diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2019-03-14 15:28:30 -0500 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2019-03-15 11:12:12 -0500 |
commit | 91375d17bdbc6461464d2fd8269fd8255a1fa6dc (patch) | |
tree | 7c10daf2b43e8342dc632e2119b29da022142e5c | |
parent | ac9223e0ea4f108da4b7ce90ca00d9fb38370aa8 (diff) |
Use version 2 of the loader/layer interface
Reviewed-by: Samuel Pitoiset samuel.pitoiset@gmail.com
-rw-r--r-- | VkLayer_vkpipeline_db.json | 6 | ||||
-rw-r--r-- | vkpipeline_db.cpp | 22 |
2 files changed, 21 insertions, 7 deletions
diff --git a/VkLayer_vkpipeline_db.json b/VkLayer_vkpipeline_db.json index ff92b19..4cab6e2 100644 --- a/VkLayer_vkpipeline_db.json +++ b/VkLayer_vkpipeline_db.json @@ -1,5 +1,5 @@ { - "file_format_version" : "1.0.0", + "file_format_version" : "1.1.1", "layer" : { "name": "VK_LAYER_vkpipeline_db", "type": "GLOBAL", @@ -8,8 +8,8 @@ "implementation_version": "1", "description": "vkpipeline-db capture layer", "functions": { - "vkGetInstanceProcAddr": "vkpipeline_db_GetInstanceProcAddr", - "vkGetDeviceProcAddr": "vkpipeline_db_GetDeviceProcAddr" + "vkNegotiateLoaderLayerInterfaceVersion": + "vkpipeline_db_NegotiateLoaderLayerInterfaceVersion" }, "enable_environment": { "ENABLE_VKPIPELINE_DB": "1" diff --git a/vkpipeline_db.cpp b/vkpipeline_db.cpp index 9a6262d..9d618f4 100644 --- a/vkpipeline_db.cpp +++ b/vkpipeline_db.cpp @@ -1010,9 +1010,9 @@ vkpipeline_db_CreateComputePipelines( return result; } -VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI_CALL +static PFN_vkVoidFunction vkpipeline_db_GetDeviceProcAddr(VkDevice device, const char *pName); -VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI_CALL +static PFN_vkVoidFunction vkpipeline_db_GetInstanceProcAddr(VkInstance instance, const char *pName); #define FUNC(name) (void *)vkpipeline_db_##name @@ -1048,7 +1048,7 @@ static const struct { #undef FUNC -VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI_CALL +static PFN_vkVoidFunction vkpipeline_db_GetDeviceProcAddr( VkDevice device, const char *pName) @@ -1062,7 +1062,7 @@ vkpipeline_db_GetDeviceProcAddr( return device_dispatch[GetKey(device)].GetDeviceProcAddr(device, pName); } -VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI_CALL +static PFN_vkVoidFunction vkpipeline_db_GetInstanceProcAddr( VkInstance instance, const char *pName) @@ -1075,3 +1075,17 @@ vkpipeline_db_GetInstanceProcAddr( lock_guard_t l(global_lock); return instance_dispatch[GetKey(instance)].GetInstanceProcAddr(instance, pName); } + +VK_LAYER_EXPORT VkResult VKAPI_CALL +vkpipeline_db_NegotiateLoaderLayerInterfaceVersion( + VkNegotiateLayerInterface *pVersionStruct) +{ + if (pVersionStruct->loaderLayerInterfaceVersion > 2) + pVersionStruct->loaderLayerInterfaceVersion = 2; + + pVersionStruct->pfnGetInstanceProcAddr = vkpipeline_db_GetInstanceProcAddr; + pVersionStruct->pfnGetDeviceProcAddr = vkpipeline_db_GetDeviceProcAddr; + pVersionStruct->pfnGetPhysicalDeviceProcAddr = NULL; + + return VK_SUCCESS; +} |