summaryrefslogtreecommitdiffstats
path: root/src/vulkan/anv_wsi.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-09-01 18:59:06 -0700
committerJason Ekstrand <[email protected]>2015-09-04 17:55:42 -0700
commitca3cfbf6f1e009c0208ffaa483c8a7e80394639d (patch)
tree16e4f40d8e2a879eaff8e3a23aa54626de1c716b /src/vulkan/anv_wsi.h
parent3d9fbb6575697744642c28464fb098552576ac97 (diff)
vk: Add an initial implementation of the actual Khronos WSI extension
Unfortunately, this is a very large commit and removes the old LunarG WSI extension. This is because there are a couple of entrypoints that have the same name between the two extensions so implementing them both is impractiacl. Support is still incomplete, but this is enough to get vkcube up and going again.
Diffstat (limited to 'src/vulkan/anv_wsi.h')
-rw-r--r--src/vulkan/anv_wsi.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/vulkan/anv_wsi.h b/src/vulkan/anv_wsi.h
new file mode 100644
index 00000000000..1c1870f5453
--- /dev/null
+++ b/src/vulkan/anv_wsi.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#pragma once
+
+#include "anv_private.h"
+
+enum anv_swap_chain_type {
+ ANV_SWAP_CHAIN_TYPE_X11 = 11,
+};
+
+struct anv_swap_chain {
+ enum anv_swap_chain_type type;
+
+ struct anv_device * device;
+};
+
+struct anv_x11_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_x11_swap_chain **swap_chain);
+VkResult anv_x11_destroy_swap_chain(struct anv_x11_swap_chain *swap_chain);
+VkResult anv_x11_get_swap_chain_info(struct anv_x11_swap_chain *swap_chain,
+ VkSwapChainInfoTypeWSI infoType,
+ size_t* pDataSize, void* pData);
+VkResult anv_x11_acquire_next_image(struct anv_x11_swap_chain *swap_chain,
+ uint64_t timeout,
+ VkSemaphore semaphore,
+ uint32_t *image_index);
+VkResult anv_x11_queue_present(struct anv_queue *queue,
+ struct anv_x11_swap_chain *swap_chain,
+ uint32_t image_index);