layers: Use static dispatch table maps
Changes to use dispatch table access functions.
diff --git a/layers/shader_checker.cpp b/layers/shader_checker.cpp
index 57aab4f..c3323d7 100644
--- a/layers/shader_checker.cpp
+++ b/layers/shader_checker.cpp
@@ -887,9 +887,9 @@
/* hook DextroyDevice to remove tableMap entry */
VK_LAYER_EXPORT VkResult VKAPI vkDestroyDevice(VkDevice device)
{
- VkLayerDispatchTable *pDisp = *(VkLayerDispatchTable **) device;
+ dispatch_key key = get_dispatch_key(device);
VkResult res = device_dispatch_table(device)->DestroyDevice(device);
- tableMap.erase(pDisp);
+ destroy_device_dispatch_table(key);
return res;
}
@@ -921,9 +921,9 @@
/* hook DestroyInstance to remove tableInstanceMap entry */
VK_LAYER_EXPORT VkResult VKAPI vkDestroyInstance(VkInstance instance)
{
- VkLayerInstanceDispatchTable *pDisp = *(VkLayerInstanceDispatchTable **) instance;
+ dispatch_key key = get_dispatch_key(instance);
VkResult res = instance_dispatch_table(instance)->DestroyInstance(instance);
- tableInstanceMap.erase(pDisp);
+ destroy_instance_dispatch_table(key);
return res;
}
@@ -934,7 +934,7 @@
void* pUserData,
VkDbgMsgCallback* pMsgCallback)
{
- VkLayerInstanceDispatchTable *pTable = tableInstanceMap[(VkBaseLayerObject *)instance];
+ VkLayerInstanceDispatchTable *pTable = instance_dispatch_table(instance);
return layer_create_msg_callback(instance, pTable, msgFlags, pfnMsgCallback, pUserData, pMsgCallback);
}
@@ -942,7 +942,7 @@
VkInstance instance,
VkDbgMsgCallback msgCallback)
{
- VkLayerInstanceDispatchTable *pTable = tableInstanceMap[(VkBaseLayerObject *)instance];
+ VkLayerInstanceDispatchTable *pTable = instance_dispatch_table(instance);
return layer_destroy_msg_callback(instance, pTable, msgCallback);
}