Path: blob/21.2-virgl/src/gallium/frontends/lavapipe/lvp_wsi_win32.c
4565 views
/*1* Copyright © 2016 Red Hat2* based on intel anv code:3* Copyright © 2015 Intel Corporation4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the "Software"),7* to deal in the Software without restriction, including without limitation8* the rights to use, copy, modify, merge, publish, distribute, sublicense,9* and/or sell copies of the Software, and to permit persons to whom the10* Software is furnished to do so, subject to the following conditions:11*12* The above copyright notice and this permission notice (including the next13* paragraph) shall be included in all copies or substantial portions of the14* Software.15*16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR17* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,18* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL19* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER20* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING21* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS22* IN THE SOFTWARE.23*/2425#include "wsi_common_win32.h"26#include "lvp_private.h"2728VkBool32 VKAPI_CALL lvp_GetPhysicalDeviceWin32PresentationSupportKHR(29VkPhysicalDevice physicalDevice,30uint32_t queueFamilyIndex)31{32LVP_FROM_HANDLE(lvp_physical_device, physical_device, physicalDevice);3334return wsi_win32_get_presentation_support(&physical_device->wsi_device);35}3637VkResult VKAPI_CALL lvp_CreateWin32SurfaceKHR(38VkInstance _instance,39const VkWin32SurfaceCreateInfoKHR* pCreateInfo,40const VkAllocationCallbacks* pAllocator,41VkSurfaceKHR* pSurface)42{43LVP_FROM_HANDLE(lvp_instance, instance, _instance);44const VkAllocationCallbacks *alloc;45assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR);4647if (pAllocator)48alloc = pAllocator;49else50alloc = &instance->vk.alloc;5152return wsi_create_win32_surface(_instance, alloc, pCreateInfo, pSurface);53}545556