Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/virtio/vulkan/vn_wsi_wayland.c
4560 views
1
/*
2
* Copyright 2020 Google LLC
3
* SPDX-License-Identifier: MIT
4
*
5
* based in part on anv and radv which are:
6
* Copyright © 2015 Intel Corporation
7
* Copyright © 2016 Red Hat.
8
* Copyright © 2016 Bas Nieuwenhuizen
9
*/
10
11
#include "wsi_common_wayland.h"
12
13
#include "vn_device.h"
14
#include "vn_wsi.h"
15
16
VkResult
17
vn_CreateWaylandSurfaceKHR(VkInstance _instance,
18
const VkWaylandSurfaceCreateInfoKHR *pCreateInfo,
19
const VkAllocationCallbacks *pAllocator,
20
VkSurfaceKHR *pSurface)
21
{
22
struct vn_instance *instance = vn_instance_from_handle(_instance);
23
const VkAllocationCallbacks *alloc =
24
pAllocator ? pAllocator : &instance->base.base.alloc;
25
26
VkResult result = wsi_create_wl_surface(alloc, pCreateInfo, pSurface);
27
28
return vn_result(instance, result);
29
}
30
31
VkBool32
32
vn_GetPhysicalDeviceWaylandPresentationSupportKHR(
33
VkPhysicalDevice physicalDevice,
34
uint32_t queueFamilyIndex,
35
struct wl_display *display)
36
{
37
struct vn_physical_device *physical_dev =
38
vn_physical_device_from_handle(physicalDevice);
39
40
return wsi_wl_get_presentation_support(&physical_dev->wsi_device, display);
41
}
42
43