Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
vk_layer.h
Go to the documentation of this file.
1/*
2 * Copyright 2015-2023 The Khronos Group Inc.
3 * Copyright 2015-2023 Valve Corporation
4 * Copyright 2015-2023 LunarG, Inc.
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8#pragma once
9
10/* Need to define dispatch table
11 * Core struct can then have ptr to dispatch table at the top
12 * Along with object ptrs for current and next OBJ
13 */
14
15#include "vulkan_core.h"
16
17#define MAX_NUM_UNKNOWN_EXTS 250
18
19 // Loader-Layer version negotiation API. Versions add the following features:
20 // Versions 0/1 - Initial. Doesn't support vk_layerGetPhysicalDeviceProcAddr
21 // or vk_icdNegotiateLoaderLayerInterfaceVersion.
22 // Version 2 - Add support for vk_layerGetPhysicalDeviceProcAddr and
23 // vk_icdNegotiateLoaderLayerInterfaceVersion.
24#define CURRENT_LOADER_LAYER_INTERFACE_VERSION 2
25#define MIN_SUPPORTED_LOADER_LAYER_INTERFACE_VERSION 1
26
27#define VK_CURRENT_CHAIN_VERSION 1
28
29// Typedef for use in the interfaces below
30typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char* pName);
31
32// Version negotiation values
37
38// Version negotiation structures
47
48// Version negotiation functions
50
51// Function prototype for unknown physical device extension command
52typedef VkResult(VKAPI_PTR *PFN_PhysDevExt)(VkPhysicalDevice phys_device);
53
54// ------------------------------------------------------------------------------------------------
55// CreateInstance and CreateDevice support structures
56
57/* Sub type of structure for instance and device loader ext of CreateInfo.
58 * When sType == VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO
59 * or sType == VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO
60 * then VkLayerFunction indicates struct type pointed to by pNext
61 */
68
74
75/*
76 * When creating the device chain the loader needs to pass
77 * down information about it's device structure needed at
78 * the end of the chain. Passing the data via the
79 * VkLayerDeviceInfo avoids issues with finding the
80 * exact instance being used.
81 */
86
87typedef VkResult (VKAPI_PTR *PFN_vkSetInstanceLoaderData)(VkInstance instance,
88 void *object);
89typedef VkResult (VKAPI_PTR *PFN_vkSetDeviceLoaderData)(VkDevice device,
90 void *object);
91typedef VkResult (VKAPI_PTR *PFN_vkLayerCreateDevice)(VkInstance instance, VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo,
92 const VkAllocationCallbacks *pAllocator, VkDevice *pDevice, PFN_vkGetInstanceProcAddr layerGIPA, PFN_vkGetDeviceProcAddr *nextGDPA);
93typedef void (VKAPI_PTR *PFN_vkLayerDestroyDevice)(VkDevice physicalDevice, const VkAllocationCallbacks *pAllocator, PFN_vkDestroyDevice destroyFunction);
94
99
114
120
130
131#ifdef __cplusplus
132extern "C" {
133#endif
134
136
143
149
152 VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceExtensionPropertiesChain *, const char *, uint32_t *,
155
156#if defined(__cplusplus)
157 inline VkResult CallDown(const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) const {
158 return pfnNextLayer(pNextLink, pLayerName, pPropertyCount, pProperties);
159 }
160#endif
162
167
168#if defined(__cplusplus)
169 inline VkResult CallDown(uint32_t *pPropertyCount, VkLayerProperties *pProperties) const {
170 return pfnNextLayer(pNextLink, pPropertyCount, pProperties);
171 }
172#endif
174
177 VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceVersionChain *, uint32_t *);
179
180#if defined(__cplusplus)
181 inline VkResult CallDown(uint32_t *pApiVersion) const {
182 return pfnNextLayer(pNextLink, pApiVersion);
183 }
184#endif
186
187#ifdef __cplusplus
188}
189#endif
uint32_t size
Definition vk_layer.h:147
VkChainType type
Definition vk_layer.h:145
uint32_t version
Definition vk_layer.h:146
const char uint32_t VkExtensionProperties *const struct VkEnumerateInstanceExtensionPropertiesChain * pNextLink
Definition vk_layer.h:154
VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceExtensionPropertiesChain *
VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceLayerPropertiesChain *
uint32_t VkLayerProperties *const struct VkEnumerateInstanceLayerPropertiesChain * pNextLink
Definition vk_layer.h:166
VkResult(VKAPI_PTR *pfnNextLayer)(const struct VkEnumerateInstanceVersionChain *
uint32_t *const struct VkEnumerateInstanceVersionChain * pNextLink
Definition vk_layer.h:178
VkStructureType sType
Definition vk_layer.h:122
VkLayerDeviceLink * pLayerInfo
Definition vk_layer.h:126
VkLayerFunction function
Definition vk_layer.h:124
PFN_vkSetDeviceLoaderData pfnSetDeviceLoaderData
Definition vk_layer.h:127
PFN_vkGetInstanceProcAddr pfnNextGetInstanceProcAddr
Definition vk_layer.h:84
VkLayerInstanceLink * pLayerInfo
Definition vk_layer.h:105
PFN_vkSetInstanceLoaderData pfnSetInstanceLoaderData
Definition vk_layer.h:106
PFN_vkLayerCreateDevice pfnLayerCreateDevice
Definition vk_layer.h:108
VkLoaderFeatureFlags loaderFeatures
Definition vk_layer.h:111
VkStructureType sType
Definition vk_layer.h:101
PFN_vkLayerDestroyDevice pfnLayerDestroyDevice
Definition vk_layer.h:109
VkLayerFunction function
Definition vk_layer.h:103
VkNegotiateLayerStructType sType
Definition vk_layer.h:40
uint32_t loaderLayerInterfaceVersion
Definition vk_layer.h:42
PFN_vkGetDeviceProcAddr pfnGetDeviceProcAddr
Definition vk_layer.h:44
PFN_GetPhysicalDeviceProcAddr pfnGetPhysicalDeviceProcAddr
Definition vk_layer.h:45
PFN_vkGetInstanceProcAddr pfnGetInstanceProcAddr
Definition vk_layer.h:43
VKAPI_ATTR VkResult VKAPI_CALL vkNegotiateLoaderLayerInterfaceVersion(VkNegotiateLayerInterface *pVersionStruct)
VkResult(VKAPI_PTR * PFN_vkSetDeviceLoaderData)(VkDevice device, void *object)
Definition vk_layer.h:89
struct VkEnumerateInstanceVersionChain VkEnumerateInstanceVersionChain
struct VkLayerDeviceInfo_ VkLayerDeviceInfo
struct VkChainHeader VkChainHeader
VkResult(VKAPI_PTR * PFN_vkLayerCreateDevice)(VkInstance instance, VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice, PFN_vkGetInstanceProcAddr layerGIPA, PFN_vkGetDeviceProcAddr *nextGDPA)
Definition vk_layer.h:91
VkResult(VKAPI_PTR * PFN_PhysDevExt)(VkPhysicalDevice phys_device)
Definition vk_layer.h:52
VkChainType
Definition vk_layer.h:137
@ VK_CHAIN_TYPE_UNKNOWN
Definition vk_layer.h:138
@ VK_CHAIN_TYPE_ENUMERATE_INSTANCE_VERSION
Definition vk_layer.h:141
@ VK_CHAIN_TYPE_ENUMERATE_INSTANCE_LAYER_PROPERTIES
Definition vk_layer.h:140
@ VK_CHAIN_TYPE_ENUMERATE_INSTANCE_EXTENSION_PROPERTIES
Definition vk_layer.h:139
struct VkEnumerateInstanceExtensionPropertiesChain VkEnumerateInstanceExtensionPropertiesChain
struct VkNegotiateLayerInterface VkNegotiateLayerInterface
VkResult(VKAPI_PTR * PFN_vkSetInstanceLoaderData)(VkInstance instance, void *object)
Definition vk_layer.h:87
PFN_vkVoidFunction(VKAPI_PTR * PFN_GetPhysicalDeviceProcAddr)(VkInstance instance, const char *pName)
Definition vk_layer.h:30
VkResult(VKAPI_PTR * PFN_vkNegotiateLoaderLayerInterfaceVersion)(VkNegotiateLayerInterface *pVersionStruct)
Definition vk_layer.h:49
VkNegotiateLayerStructType
Definition vk_layer.h:33
@ LAYER_NEGOTIATE_INTERFACE_STRUCT
Definition vk_layer.h:35
@ LAYER_NEGOTIATE_UNINTIALIZED
Definition vk_layer.h:34
struct VkLayerInstanceLink_ VkLayerInstanceLink
struct VkEnumerateInstanceLayerPropertiesChain VkEnumerateInstanceLayerPropertiesChain
VkLayerFunction_
Definition vk_layer.h:62
@ VK_LAYER_LINK_INFO
Definition vk_layer.h:63
@ VK_LOADER_FEATURES
Definition vk_layer.h:66
@ VK_LOADER_DATA_CALLBACK
Definition vk_layer.h:64
@ VK_LOADER_LAYER_CREATE_DEVICE_CALLBACK
Definition vk_layer.h:65
void(VKAPI_PTR * PFN_vkLayerDestroyDevice)(VkDevice physicalDevice, const VkAllocationCallbacks *pAllocator, PFN_vkDestroyDevice destroyFunction)
Definition vk_layer.h:93
enum VkLayerFunction_ VkLayerFunction
struct VkLayerDeviceLink_ VkLayerDeviceLink
VkFlags VkLoaderFeatureFlags
Definition vk_layer.h:98
VkLoaderFeastureFlagBits
Definition vk_layer.h:95
@ VK_LOADER_FEATURE_PHYSICAL_DEVICE_SORTING
Definition vk_layer.h:96
enum VkLoaderFeastureFlagBits VkLoaderFlagBits
#define VKAPI_CALL
Definition vk_platform.h:57
#define VKAPI_ATTR
Definition vk_platform.h:56
#define VKAPI_PTR
Definition vk_platform.h:58
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetDeviceProcAddr)(VkDevice device, const char *pName)
void(VKAPI_PTR * PFN_vkDestroyDevice)(VkDevice device, const VkAllocationCallbacks *pAllocator)
uint32_t VkFlags
VkResult
void(VKAPI_PTR * PFN_vkVoidFunction)(void)
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetInstanceProcAddr)(VkInstance instance, const char *pName)
VkStructureType