vulkan/wsi: Add a WSI_FROM_HANDLE macro
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 16 Nov 2017 17:39:50 +0000 (09:39 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 4 Dec 2017 18:04:19 +0000 (10:04 -0800)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
src/vulkan/wsi/wsi_common.h

index a5e7e655fc850def15282da320e327300498539c..229d3983af52a3134944aa7a24358e6bec806851 100644 (file)
@@ -177,6 +177,9 @@ struct wsi_callbacks {
       return (__VkType)(uintptr_t) _obj;                                   \
    }
 
+#define WSI_FROM_HANDLE(__wsi_type, __name, __handle) \
+   struct __wsi_type *__name = __wsi_type ## _from_handle(__handle)
+
 WSI_DEFINE_NONDISP_HANDLE_CASTS(wsi_swapchain, VkSwapchainKHR)
 
 #define ICD_DEFINE_NONDISP_HANDLE_CASTS(__VkIcdType, __VkType)             \