Path: blob/21.2-virgl/src/vulkan/util/vk_instance.h
7076 views
/*1* Copyright © 2021 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*/22#ifndef VK_INSTANCE_H23#define VK_INSTANCE_H2425#include "vk_dispatch_table.h"26#include "vk_extensions.h"27#include "vk_object.h"2829#include "c11/threads.h"30#include "util/list.h"3132#ifdef __cplusplus33extern "C" {34#endif3536struct vk_app_info {37const char* app_name;38uint32_t app_version;39const char* engine_name;40uint32_t engine_version;41uint32_t api_version;42};4344struct vk_instance {45struct vk_object_base base;46VkAllocationCallbacks alloc;4748struct vk_app_info app_info;49struct vk_instance_extension_table enabled_extensions;5051struct vk_instance_dispatch_table dispatch_table;5253/* VK_EXT_debug_report debug callbacks */54struct {55mtx_t callbacks_mutex;56struct list_head callbacks;57} debug_report;58};5960VK_DEFINE_HANDLE_CASTS(vk_instance, base, VkInstance,61VK_OBJECT_TYPE_INSTANCE)6263VkResult MUST_CHECK64vk_instance_init(struct vk_instance *instance,65const struct vk_instance_extension_table *supported_extensions,66const struct vk_instance_dispatch_table *dispatch_table,67const VkInstanceCreateInfo *pCreateInfo,68const VkAllocationCallbacks *alloc);6970void71vk_instance_finish(struct vk_instance *instance);7273VkResult74vk_enumerate_instance_extension_properties(75const struct vk_instance_extension_table *supported_extensions,76uint32_t *pPropertyCount,77VkExtensionProperties *pProperties);7879PFN_vkVoidFunction80vk_instance_get_proc_addr(const struct vk_instance *instance,81const struct vk_instance_entrypoint_table *entrypoints,82const char *name);8384PFN_vkVoidFunction85vk_instance_get_proc_addr_unchecked(const struct vk_instance *instance,86const char *name);8788PFN_vkVoidFunction89vk_instance_get_physical_device_proc_addr(const struct vk_instance *instance,90const char *name);9192#ifdef __cplusplus93}94#endif9596#endif /* VK_INSTANCE_H */979899