Path: blob/21.2-virgl/src/gallium/frontends/lavapipe/lvp_wsi.h
4565 views
/*1* Copyright © 2015 Intel Corporation2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS20* IN THE SOFTWARE.21*/2223#pragma once2425#include "lvp_private.h"2627struct lvp_swapchain;2829struct lvp_wsi_interface {30VkResult (*get_support)(VkIcdSurfaceBase *surface,31struct lvp_physical_device *device,32uint32_t queueFamilyIndex,33VkBool32* pSupported);34VkResult (*get_capabilities)(VkIcdSurfaceBase *surface,35struct lvp_physical_device *device,36VkSurfaceCapabilitiesKHR* pSurfaceCapabilities);37VkResult (*get_formats)(VkIcdSurfaceBase *surface,38struct lvp_physical_device *device,39uint32_t* pSurfaceFormatCount,40VkSurfaceFormatKHR* pSurfaceFormats);41VkResult (*get_present_modes)(VkIcdSurfaceBase *surface,42struct lvp_physical_device *device,43uint32_t* pPresentModeCount,44VkPresentModeKHR* pPresentModes);45VkResult (*create_swapchain)(VkIcdSurfaceBase *surface,46struct lvp_device *device,47const VkSwapchainCreateInfoKHR* pCreateInfo,48const VkAllocationCallbacks* pAllocator,49struct lvp_swapchain **swapchain);50};5152struct lvp_swapchain {53struct lvp_device *device;5455VkResult (*destroy)(struct lvp_swapchain *swapchain,56const VkAllocationCallbacks *pAllocator);57VkResult (*get_images)(struct lvp_swapchain *swapchain,58uint32_t *pCount, VkImage *pSwapchainImages);59VkResult (*acquire_next_image)(struct lvp_swapchain *swap_chain,60uint64_t timeout, VkSemaphore semaphore,61uint32_t *image_index);62VkResult (*queue_present)(struct lvp_swapchain *swap_chain,63struct lvp_queue *queue,64uint32_t image_index);65};6667VkResult lvp_x11_init_wsi(struct lvp_instance *instance);68void lvp_x11_finish_wsi(struct lvp_instance *instance);69VkResult lvp_wl_init_wsi(struct lvp_instance *instance);70void lvp_wl_finish_wsi(struct lvp_instance *instance);717273