diff options
| author | Jon Ashburn <jon@lunarg.com> | 2015-09-17 10:00:32 -0600 |
|---|---|---|
| committer | Jon Ashburn <jon@lunarg.com> | 2015-09-17 15:29:28 -0600 |
| commit | 0f25cbe274d5d69751b96c58fbc078f164227d31 (patch) | |
| tree | e3425064c31c4c9929b9c1f98e61fdcd4b8ba44e /layers | |
| parent | 0d740a07716a6381782af89fffe51fffcbb6b10b (diff) | |
| download | usermoji-0f25cbe274d5d69751b96c58fbc078f164227d31.tar.xz | |
layers: Fix intercept of WSI instance entrypoints
ApiDump, Generic, ObjectTracker now intrcept WSI instance entrypoint and
only intercept if the extension is enabled
Diffstat (limited to 'layers')
| -rw-r--r-- | layers/object_track.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/layers/object_track.h b/layers/object_track.h index 694aa93f..0ae9017e 100644 --- a/layers/object_track.h +++ b/layers/object_track.h @@ -73,6 +73,11 @@ typedef struct _layer_data { bool objtrack_extensions_enabled; } layer_data; +struct instExts { + bool wsi_enabled; +}; + +static std::unordered_map<void *, struct instExts> instanceExtMap; static std::unordered_map<void*, layer_data *> layer_data_map; static device_table_map ObjectTracker_device_table_map; static instance_table_map ObjectTracker_instance_table_map; @@ -198,6 +203,20 @@ static void createDeviceRegisterExtensions(const VkDeviceCreateInfo* pCreateInfo } } +static void createInstanceRegisterExtensions(const VkInstanceCreateInfo* pCreateInfo, VkInstance instance) +{ + uint32_t i; + VkLayerInstanceDispatchTable *pDisp = get_dispatch_table(ObjectTracker_instance_table_map, instance); + PFN_vkGetInstanceProcAddr gpa = pDisp->GetInstanceProcAddr; + pDisp->GetPhysicalDeviceSurfaceSupportKHR = (PFN_vkGetPhysicalDeviceSurfaceSupportKHR) gpa(instance, "vkGetPhysicalDeviceSurfaceSupportKHR"); + instanceExtMap[pDisp].wsi_enabled = false; + for (i = 0; i < pCreateInfo->extensionCount; i++) { + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_KHR_SWAPCHAIN_EXTENSION_NAME) == 0) + instanceExtMap[pDisp].wsi_enabled = true; + + } +} + // Indicate device or instance dispatch table type typedef enum _DispTableType { @@ -612,6 +631,7 @@ explicit_CreateInstance( *pInstance, pCreateInfo->extensionCount, pCreateInfo->ppEnabledExtensionNames); + createInstanceRegisterExtensions(pCreateInfo, *pInstance); initObjectTracker(my_data); create_obj(*pInstance, *pInstance, VK_OBJECT_TYPE_INSTANCE); |
