From a1de4b2dffb98222ca59f4a70c301d22bb4c089e Mon Sep 17 00:00:00 2001 From: Courtney Goeltzenleuchter Date: Fri, 8 Jan 2016 12:18:43 -0700 Subject: loader: implement new layer init method New layer init method requires the construction of Link information for CreateInstance and CreateDevice that is accessible to layers via the CreateInfo.pNext pointer. The layer can then use the Get*ProcAddr from the Link structure to initialize their dispatch table if the call down the chain returns successfully. This removes the need to do special initialization work at Get*ProcAddr time. Layer Get*ProcAddr now return their internal function pointers regardless of the value of instance or device. Only need to have valid instance & device when looking up extensions or when passing the request down the chain. This mechanism allows us to remove object wrapping used by the loader previously. Also simplifies the dispatch table setup. Conflicts: layers/device_limits.cpp layers/draw_state.cpp loader/loader.c loader/trampoline.c --- loader/loader.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'loader/loader.h') diff --git a/loader/loader.h b/loader/loader.h index b5b3d2c9..55662b73 100644 --- a/loader/loader.h +++ b/loader/loader.h @@ -241,6 +241,8 @@ struct loader_instance { struct loader_layer_list activated_layer_list; + VkInstance instance; + bool debug_report_enabled; VkLayerDbgFunctionNode *DbgFunctionHead; @@ -425,6 +427,12 @@ VKAPI_ATTR void VKAPI_CALL loader_GetPhysicalDeviceMemoryProperties ( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties * pProperties); +VkResult loader_create_device_terminator( + VkPhysicalDevice physicalDevice, + const VkDeviceCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDevice* pDevice); + VKAPI_ATTR VkResult VKAPI_CALL loader_CreateDevice( VkPhysicalDevice gpu, const VkDeviceCreateInfo* pCreateInfo, @@ -490,7 +498,11 @@ VkResult loader_enable_instance_layers( const VkInstanceCreateInfo *pCreateInfo, const struct loader_layer_list *instance_layers); void loader_deactivate_instance_layers(struct loader_instance *instance); -uint32_t loader_activate_instance_layers(struct loader_instance *inst); + +VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, + const VkAllocationCallbacks* pAllocator, + struct loader_instance *inst); + void loader_activate_instance_layer_extensions(struct loader_instance *inst, VkInstance created_inst); void* loader_heap_alloc( -- cgit v1.2.3