From ddca7b207067f44df0990a697b9471efdef8b066 Mon Sep 17 00:00:00 2001 From: Mark Young Date: Tue, 28 Jun 2016 10:52:43 -0600 Subject: loader: gh181 use ICD for SurfaceKHR Use the ICD to create and destroy VkSurfaceKHR objects instead of just performing the work in the ICD. This only occurs if the ICD exports the appropriate entry-points, and exposes version 3 of the loader/icd interface. Change-Id: I5e7bf9506318823c57ad75cf19d3f53fdfa6451e --- loader/table_ops.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'loader/table_ops.h') diff --git a/loader/table_ops.h b/loader/table_ops.h index cb84b87c..427a7f62 100644 --- a/loader/table_ops.h +++ b/loader/table_ops.h @@ -31,7 +31,7 @@ static VkResult vkDevExtError(VkDevice dev) { struct loader_device *found_dev; - struct loader_icd *icd = loader_get_icd_and_device(dev, &found_dev); + struct loader_icd *icd = loader_get_icd_and_device(dev, &found_dev, NULL); if (icd) loader_log(icd->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -540,6 +540,20 @@ loader_lookup_device_dispatch_table(const VkLayerDispatchTable *table, if (!strcmp(name, "CmdExecuteCommands")) return (void *)table->CmdExecuteCommands; + if (!strcmp(name, "CreateSwapchainKHR")) { + // For CreateSwapChainKHR we need to use the entry and terminator + // functions to properly unwrap the SurfaceKHR object. + return (void *)vkCreateSwapchainKHR; + } + if (!strcmp(name, "DestroySwapchainKHR")) + return (void *)table->DestroySwapchainKHR; + if (!strcmp(name, "GetSwapchainImagesKHR")) + return (void *)table->GetSwapchainImagesKHR; + if (!strcmp(name, "AcquireNextImageKHR")) + return (void *)table->AcquireNextImageKHR; + if (!strcmp(name, "QueuePresentKHR")) + return (void *)table->QueuePresentKHR; + return NULL; } -- cgit v1.2.3