From 764fc1643c10ca1f336a99ddbe727313c995b6bb Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 15 Nov 2017 18:50:44 -0800 Subject: vulkan/wsi: Add a wsi_device_init function This gives the opportunity to collect some function pointers if we'd like which will be very useful in future. Reviewed-by: Dave Airlie Reviewed-by: Chad Versace --- src/intel/vulkan/anv_wsi.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/intel/vulkan') diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c index d8c4885b5b8..f898a0759d0 100644 --- a/src/intel/vulkan/anv_wsi.c +++ b/src/intel/vulkan/anv_wsi.c @@ -33,12 +33,21 @@ static const struct wsi_callbacks wsi_cbs = { }; #endif +static PFN_vkVoidFunction +anv_wsi_proc_addr(VkPhysicalDevice physicalDevice, const char *pName) +{ + ANV_FROM_HANDLE(anv_physical_device, physical_device, physicalDevice); + return anv_lookup_entrypoint(&physical_device->info, pName); +} + VkResult anv_init_wsi(struct anv_physical_device *physical_device) { VkResult result; - memset(physical_device->wsi_device.wsi, 0, sizeof(physical_device->wsi_device.wsi)); + wsi_device_init(&physical_device->wsi_device, + anv_physical_device_to_handle(physical_device), + anv_wsi_proc_addr); #ifdef VK_USE_PLATFORM_XCB_KHR result = wsi_x11_init_wsi(&physical_device->wsi_device, &physical_device->instance->alloc); -- cgit v1.2.3