diff options
author | Jason Ekstrand <[email protected]> | 2015-09-04 11:14:45 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-09-04 17:55:42 -0700 |
commit | 348cb29a20e5076b84d0e6d01ffa7b6128b80ea8 (patch) | |
tree | ce3a9661c82302e7e22ca1a90e1a0759e538028f /src/vulkan/anv_wsi.h | |
parent | 06d8fd58818c4574ba233edb4566509577d79dd0 (diff) |
vk/wsi: Move to a clallback system for the entire WSI implementation
We do this for two reasons: First, because it allows us to simplify WSI and
compiling in/out support for a particular platform is as simple as calling
or not calling the platform-specific init function. Second, the
implementation gives us a place for a given chunk of the WSI to stash
stuff in the instance.
Diffstat (limited to 'src/vulkan/anv_wsi.h')
-rw-r--r-- | src/vulkan/anv_wsi.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/vulkan/anv_wsi.h b/src/vulkan/anv_wsi.h index 3a5fba13a56..3ee3fcee56d 100644 --- a/src/vulkan/anv_wsi.h +++ b/src/vulkan/anv_wsi.h @@ -42,10 +42,21 @@ struct anv_swap_chain { ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_swap_chain, VkSwapChainWSI) -VkResult anv_x11_get_surface_info(struct anv_device *device, - VkSurfaceDescriptionWindowWSI *window, - VkSurfaceInfoTypeWSI infoType, - size_t* pDataSize, void* pData); -VkResult anv_x11_create_swap_chain(struct anv_device *device, - const VkSwapChainCreateInfoWSI *pCreateInfo, - struct anv_swap_chain **swap_chain); +struct anv_wsi_implementation { + VkResult (*get_window_supported)(struct anv_wsi_implementation *impl, + struct anv_physical_device *physical_device, + const VkSurfaceDescriptionWindowWSI *window, + VkBool32 *pSupported); + VkResult (*get_surface_info)(struct anv_wsi_implementation *impl, + struct anv_device *device, + VkSurfaceDescriptionWindowWSI *window, + VkSurfaceInfoTypeWSI infoType, + size_t* pDataSize, void* pData); + VkResult (*create_swap_chain)(struct anv_wsi_implementation *impl, + struct anv_device *device, + const VkSwapChainCreateInfoWSI *pCreateInfo, + struct anv_swap_chain **swap_chain); +}; + +VkResult anv_x11_init_wsi(struct anv_instance *instance); +void anv_x11_finish_wsi(struct anv_instance *instance); |