Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/vulkan/util/vk_instance.h
7076 views
1
/*
2
* Copyright © 2021 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
#ifndef VK_INSTANCE_H
24
#define VK_INSTANCE_H
25
26
#include "vk_dispatch_table.h"
27
#include "vk_extensions.h"
28
#include "vk_object.h"
29
30
#include "c11/threads.h"
31
#include "util/list.h"
32
33
#ifdef __cplusplus
34
extern "C" {
35
#endif
36
37
struct vk_app_info {
38
const char* app_name;
39
uint32_t app_version;
40
const char* engine_name;
41
uint32_t engine_version;
42
uint32_t api_version;
43
};
44
45
struct vk_instance {
46
struct vk_object_base base;
47
VkAllocationCallbacks alloc;
48
49
struct vk_app_info app_info;
50
struct vk_instance_extension_table enabled_extensions;
51
52
struct vk_instance_dispatch_table dispatch_table;
53
54
/* VK_EXT_debug_report debug callbacks */
55
struct {
56
mtx_t callbacks_mutex;
57
struct list_head callbacks;
58
} debug_report;
59
};
60
61
VK_DEFINE_HANDLE_CASTS(vk_instance, base, VkInstance,
62
VK_OBJECT_TYPE_INSTANCE)
63
64
VkResult MUST_CHECK
65
vk_instance_init(struct vk_instance *instance,
66
const struct vk_instance_extension_table *supported_extensions,
67
const struct vk_instance_dispatch_table *dispatch_table,
68
const VkInstanceCreateInfo *pCreateInfo,
69
const VkAllocationCallbacks *alloc);
70
71
void
72
vk_instance_finish(struct vk_instance *instance);
73
74
VkResult
75
vk_enumerate_instance_extension_properties(
76
const struct vk_instance_extension_table *supported_extensions,
77
uint32_t *pPropertyCount,
78
VkExtensionProperties *pProperties);
79
80
PFN_vkVoidFunction
81
vk_instance_get_proc_addr(const struct vk_instance *instance,
82
const struct vk_instance_entrypoint_table *entrypoints,
83
const char *name);
84
85
PFN_vkVoidFunction
86
vk_instance_get_proc_addr_unchecked(const struct vk_instance *instance,
87
const char *name);
88
89
PFN_vkVoidFunction
90
vk_instance_get_physical_device_proc_addr(const struct vk_instance *instance,
91
const char *name);
92
93
#ifdef __cplusplus
94
}
95
#endif
96
97
#endif /* VK_INSTANCE_H */
98
99