From 26a6d16db0f9512f719a40529acf46c0277e877e Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Thu, 3 Nov 2022 06:32:23 +0800 Subject: zink: Only #include instead #include in kopper_interface.h It's pulled too much system dependent headers before this commit when #include directly, Signed-off-by: Yonggang Luo Reviewed-by: Adam Jackson Part-of: --- include/kopper_interface.h | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) (limited to 'include') diff --git a/include/kopper_interface.h b/include/kopper_interface.h index 33826e6ff33..3db53e8d52c 100644 --- a/include/kopper_interface.h +++ b/include/kopper_interface.h @@ -35,17 +35,7 @@ #define KOPPER_INTERFACE_H #include -#include -#ifdef VK_USE_PLATFORM_XCB_KHR -#include -#include -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR -#include -#endif -#ifdef VK_USE_PLATFORM_WIN32_KHR -#include -#endif +#include typedef struct __DRIkopperExtensionRec __DRIkopperExtension; typedef struct __DRIkopperLoaderExtensionRec __DRIkopperLoaderExtension; @@ -80,19 +70,23 @@ struct __DRIkopperExtensionRec { * Kopper loader extension. */ +/** + * struct for storage the union of all platform depdendent + * Vk*SurfaceCreateInfo* type, all platform Vk*SurfaceCreateInfo* contains + * uint32_t flags and at most two extra pointer besides bos header. + * For example: + * VkWin32SurfaceCreateInfoKHR contains flags, hinstance and hwnd besides bos header + */ + +struct kopper_vk_surface_create_storage { + /* First two fields are copied from VkBaseOutStructure for easily access shared properties */ + VkStructureType sType; + struct VkBaseOutStructure *pNext; + intptr_t padding[3]; +}; + struct kopper_loader_info { - union { - VkBaseOutStructure bos; -#ifdef VK_USE_PLATFORM_XCB_KHR - VkXcbSurfaceCreateInfoKHR xcb; -#endif -#ifdef VK_USE_PLATFORM_WAYLAND_KHR - VkWaylandSurfaceCreateInfoKHR wl; -#endif -#ifdef VK_USE_PLATFORM_WIN32_KHR - VkWin32SurfaceCreateInfoKHR win32; -#endif - }; + struct kopper_vk_surface_create_storage bos; int has_alpha; int initial_swap_interval; }; -- cgit v1.2.1