radeonsi: stop using TGSI_PROPERTY_CS_LOCAL_SIZE
[mesa.git] / src / gallium / frontends / vallium / val_wsi.h
1 /*
2 * Copyright © 2015 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 */
23
24 #pragma once
25
26 #include "val_private.h"
27
28 struct val_swapchain;
29
30 struct val_wsi_interface {
31 VkResult (*get_support)(VkIcdSurfaceBase *surface,
32 struct val_physical_device *device,
33 uint32_t queueFamilyIndex,
34 VkBool32* pSupported);
35 VkResult (*get_capabilities)(VkIcdSurfaceBase *surface,
36 struct val_physical_device *device,
37 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities);
38 VkResult (*get_formats)(VkIcdSurfaceBase *surface,
39 struct val_physical_device *device,
40 uint32_t* pSurfaceFormatCount,
41 VkSurfaceFormatKHR* pSurfaceFormats);
42 VkResult (*get_present_modes)(VkIcdSurfaceBase *surface,
43 struct val_physical_device *device,
44 uint32_t* pPresentModeCount,
45 VkPresentModeKHR* pPresentModes);
46 VkResult (*create_swapchain)(VkIcdSurfaceBase *surface,
47 struct val_device *device,
48 const VkSwapchainCreateInfoKHR* pCreateInfo,
49 const VkAllocationCallbacks* pAllocator,
50 struct val_swapchain **swapchain);
51 };
52
53 struct val_swapchain {
54 struct val_device *device;
55
56 VkResult (*destroy)(struct val_swapchain *swapchain,
57 const VkAllocationCallbacks *pAllocator);
58 VkResult (*get_images)(struct val_swapchain *swapchain,
59 uint32_t *pCount, VkImage *pSwapchainImages);
60 VkResult (*acquire_next_image)(struct val_swapchain *swap_chain,
61 uint64_t timeout, VkSemaphore semaphore,
62 uint32_t *image_index);
63 VkResult (*queue_present)(struct val_swapchain *swap_chain,
64 struct val_queue *queue,
65 uint32_t image_index);
66 };
67
68 VAL_DEFINE_NONDISP_HANDLE_CASTS(_VkIcdSurfaceBase, VkSurfaceKHR)
69 VAL_DEFINE_NONDISP_HANDLE_CASTS(val_swapchain, VkSwapchainKHR)
70
71 VkResult val_x11_init_wsi(struct val_instance *instance);
72 void val_x11_finish_wsi(struct val_instance *instance);
73 VkResult val_wl_init_wsi(struct val_instance *instance);
74 void val_wl_finish_wsi(struct val_instance *instance);