Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/virtio/vulkan/vn_queue.h
4560 views
1
/*
2
* Copyright 2019 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
#ifndef VN_QUEUE_H
12
#define VN_QUEUE_H
13
14
#include "vn_common.h"
15
16
struct vn_queue {
17
struct vn_object_base base;
18
19
struct vn_device *device;
20
uint32_t family;
21
uint32_t index;
22
uint32_t flags;
23
24
VkFence wait_fence;
25
};
26
VK_DEFINE_HANDLE_CASTS(vn_queue, base.base, VkQueue, VK_OBJECT_TYPE_QUEUE)
27
28
enum vn_sync_type {
29
/* no payload */
30
VN_SYNC_TYPE_INVALID,
31
32
/* device object */
33
VN_SYNC_TYPE_DEVICE_ONLY,
34
35
/* already signaled by WSI */
36
VN_SYNC_TYPE_WSI_SIGNALED,
37
};
38
39
struct vn_sync_payload {
40
enum vn_sync_type type;
41
};
42
43
struct vn_fence {
44
struct vn_object_base base;
45
46
struct vn_sync_payload *payload;
47
48
struct vn_sync_payload permanent;
49
struct vn_sync_payload temporary;
50
};
51
VK_DEFINE_NONDISP_HANDLE_CASTS(vn_fence,
52
base.base,
53
VkFence,
54
VK_OBJECT_TYPE_FENCE)
55
56
struct vn_semaphore {
57
struct vn_object_base base;
58
59
VkSemaphoreType type;
60
61
struct vn_sync_payload *payload;
62
63
struct vn_sync_payload permanent;
64
struct vn_sync_payload temporary;
65
};
66
VK_DEFINE_NONDISP_HANDLE_CASTS(vn_semaphore,
67
base.base,
68
VkSemaphore,
69
VK_OBJECT_TYPE_SEMAPHORE)
70
71
struct vn_event {
72
struct vn_object_base base;
73
};
74
VK_DEFINE_NONDISP_HANDLE_CASTS(vn_event,
75
base.base,
76
VkEvent,
77
VK_OBJECT_TYPE_EVENT)
78
79
void
80
vn_fence_signal_wsi(struct vn_device *dev, struct vn_fence *fence);
81
82
void
83
vn_semaphore_signal_wsi(struct vn_device *dev, struct vn_semaphore *sem);
84
85
#endif /* VN_QUEUE_H */
86
87