From 58d1fc661197d73b789f5d8628cbf3393529699b Mon Sep 17 00:00:00 2001 From: Courtney Goeltzenleuchter Date: Thu, 25 Jun 2015 18:01:43 -0600 Subject: loader: Move CreateDevice to device table Discovered an issue where a layer was doing cleanup in it's DestroyDevice function but the CreateDevice was never called. This happened because the extension was only enabled on the device chain and the device chain doesn't actually call CreateDevice. That happens on the Instance chain. Making it so that we can call down the device chain - which is terminated by the ICD. We need to know the real device object to construct the device chain heiarchy and when calling down the device chain it should end with the ICD doing the actual device object creation. This patch fixes the issue by using the same process as CreateInstance. The loader will call the ICD's CreateDevice and pass that in the *pDevice argument. The layers then ignore the PhysicalDevice parameter and use the *pDevice to access the device chain. To prevent the ICD from being called twice needed to stub in a special loader_GetDeviceChainProcAddr to provide a stub for only CreateDevice as the end of the chain. --- include/vkLayer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/vkLayer.h b/include/vkLayer.h index 3742725b..9d4ab95b 100644 --- a/include/vkLayer.h +++ b/include/vkLayer.h @@ -141,6 +141,7 @@ typedef struct VkLayerInstanceDispatchTable_ PFN_vkGetInstanceProcAddr GetInstanceProcAddr; PFN_vkCreateInstance CreateInstance; PFN_vkDestroyInstance DestroyInstance; + PFN_vkCreateDevice CreateDevice; PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices; PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures; PFN_vkGetPhysicalDeviceFormatInfo GetPhysicalDeviceFormatInfo; -- cgit v1.2.3