Use layer specific dispatch table maps

This commit is contained in:
GregF authored and baldurk committed 2016-02-07 18:39:28 +01:00
1 parent e3f4a122fc
commit a8dfd36525
3 files changed
+273 -261

No files matched your search

@@ -49,3 +49,7 @@ VkLayerInstanceDispatchTable *get_dispatch_table(instance_table_map &map, void*
void destroy_device_dispatch_table(dispatch_key key);
void destroy_instance_dispatch_table(dispatch_key key);
void destroy_dispatch_table(device_table_map &map, dispatch_key key);
void destroy_dispatch_table(instance_table_map &map, dispatch_key key);
+10 -6
View File
@@ -55,6 +55,10 @@
WrappedVulkan *shadowVulkan = NULL;
// probably should not be extern in final release
extern device_table_map renderdoc_device_table_map;
extern instance_table_map renderdoc_instance_table_map;
// Layer Intercepts
static const VkLayerProperties rdt_physicaldevice_layers[] = {
@@ -193,7 +197,7 @@ VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetDeviceProcAddr(VkDevice device, co
/* loader uses this to force layer initialization; device object is wrapped */
if (!strcmp("vkGetDeviceProcAddr", pName)) {
initDeviceTable((const VkBaseLayerObject *) device);
initDeviceTable(renderdoc_device_table_map, (const VkBaseLayerObject *) device);
return (PFN_vkVoidFunction) vkGetDeviceProcAddr;
}
@@ -205,9 +209,9 @@ VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetDeviceProcAddr(VkDevice device, co
return (PFN_vkVoidFunction) vkDestroyDevice;
else
{
if (device_dispatch_table(device)->GetDeviceProcAddr == NULL)
if (get_dispatch_table(renderdoc_device_table_map, device)->GetDeviceProcAddr == NULL)
return NULL;
return device_dispatch_table(device)->GetDeviceProcAddr(device, pName);
return get_dispatch_table(renderdoc_device_table_map, device)->GetDeviceProcAddr(device, pName);
}
}
@@ -218,7 +222,7 @@ VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetInstanceProcAddr(VkInstance instan
/* loader uses this to force layer initialization; instance object is wrapped */
if (!strcmp("vkGetInstanceProcAddr", pName)) {
initInstanceTable((const VkBaseLayerObject *) instance);
initInstanceTable(renderdoc_instance_table_map, (const VkBaseLayerObject *) instance);
if (shadowVulkan == NULL) {
shadowVulkan = new WrappedVulkan("");
}
@@ -234,8 +238,8 @@ VK_LAYER_EXPORT PFN_vkVoidFunction VKAPI vkGetInstanceProcAddr(VkInstance instan
if (!strcmp("vkGetGlobalLayerProperties", pName))
return (PFN_vkVoidFunction) vkGetGlobalLayerProperties;
if (instance_dispatch_table(instance)->GetInstanceProcAddr == NULL)
if (get_dispatch_table(renderdoc_instance_table_map, instance)->GetInstanceProcAddr == NULL)
return NULL;
return instance_dispatch_table(instance)->GetInstanceProcAddr(instance, pName);
return get_dispatch_table(renderdoc_instance_table_map, instance)->GetInstanceProcAddr(instance, pName);
}
File diff suppressed because it is too large. Load diff