aboutsummaryrefslogtreecommitdiff
path: root/include/vulkan
diff options
context:
space:
mode:
authorIan Elliott <ianelliott@google.com>2015-11-18 12:19:12 -0700
committerJon Ashburn <jon@lunarg.com>2015-12-01 10:18:23 -0700
commit11b4cd253e18c29a90b469abbb730aeddbd11bcb (patch)
treebbe9cede570f07a27f8bb3c1e711b89a6b385b6c /include/vulkan
parent6eb187e801b4c4d25bc8265cc6f15191eee6c966 (diff)
downloadusermoji-11b4cd253e18c29a90b469abbb730aeddbd11bcb.tar.xz
WSI-ICD: Created per-platform structs for platform-specific info.
Per Khronos Bugzilla Bug 15077, on Windows and Linux, VkSurfaceKHR is treated as a pointer to platform-specific structs that contain the platform-specific connection and surface/window info. The Vulkan loader vkCreate*SurfaceKHR() functions will fill in the struct. ICDs and layers will cast VkSurfaceKHR to a pointer to the appropriate VkIcdSurface* struct.
Diffstat (limited to 'include/vulkan')
-rw-r--r--include/vulkan/vk_icd.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/include/vulkan/vk_icd.h b/include/vulkan/vk_icd.h
index 634d653f..43e37efc 100644
--- a/include/vulkan/vk_icd.h
+++ b/include/vulkan/vk_icd.h
@@ -29,5 +29,61 @@ static inline bool valid_loader_magic_value(void* pNewObject) {
return (loader_info->loaderMagic & 0xffffffff) == ICD_LOADER_MAGIC;
}
+/*
+ * Windows and Linux ICDs will treat VkSurfaceKHR as a pointer to a struct that
+ * contains the platform-specific connection and surface information.
+ */
+typedef enum _VkIcdWsiPlatform {
+ VK_ICD_WSI_PLATFORM_MIR,
+ VK_ICD_WSI_PLATFORM_WAYLAND,
+ VK_ICD_WSI_PLATFORM_WIN32,
+ VK_ICD_WSI_PLATFORM_XCB,
+ VK_ICD_WSI_PLATFORM_XLIB,
+} VkIcdWsiPlatform;
+
+typedef struct _VkIcdSurfaceBase {
+ VkIcdWsiPlatform platform;
+} VkIcdSurfaceBase;
+
+#ifdef VK_USE_PLATFORM_MIR_KHR
+typedef struct _VkIcdSurfaceMir {
+ VkIcdSurfaceBase base;
+ MirConnection* connection;
+ MirSurface* mirSurface;
+} VkIcdSurfaceMir;
+#endif // VK_USE_PLATFORM_MIR_KHR
+
+#ifdef VK_USE_PLATFORM_WAYLAND_KHR
+typedef struct _VkIcdSurfaceWayland {
+ VkIcdSurfaceBase base;
+ struct wl_display* display;
+ struct wl_surface* surface;
+} VkIcdSurfaceWayland;
+#endif // VK_USE_PLATFORM_WAYLAND_KHR
+
+#ifdef VK_USE_PLATFORM_WIN32_KHR
+typedef struct _VkIcdSurfaceWin32 {
+ VkIcdSurfaceBase base;
+ HINSTANCE hinstance,
+ HWND hwnd,
+} VkIcdSurfaceWin32;
+#endif // VK_USE_PLATFORM_WIN32_KHR
+
+#ifdef VK_USE_PLATFORM_XCB_KHR
+typedef struct _VkIcdSurfaceXcb {
+ VkIcdSurfaceBase base;
+ xcb_connection_t* connection;
+ xcb_window_t window;
+} VkIcdSurfaceXcb;
+#endif // VK_USE_PLATFORM_XCB_KHR
+
+#ifdef VK_USE_PLATFORM_XLIB_KHR
+typedef struct _VkIcdSurfaceXlib {
+ VkIcdSurfaceBase base;
+ Display* dpy;
+ Window window;
+} VkIcdSurfaceXlib;
+#endif // VK_USE_PLATFORM_XLIB_KHR
+
#endif // VKICD_H