Update the Vulkan loader to SDK 1.0.46.0
This commit is contained in:
508
third_party/vulkan/loader/loader.h
vendored
508
third_party/vulkan/loader/loader.h
vendored
@@ -32,9 +32,9 @@
|
||||
#include "vk_loader_platform.h"
|
||||
#include "vk_loader_layer.h"
|
||||
#include <vulkan/vk_layer.h>
|
||||
|
||||
#include <vulkan/vk_icd.h>
|
||||
#include <assert.h>
|
||||
#include "vk_loader_extensions.h"
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
#define LOADER_EXPORT __attribute__((visibility("default")))
|
||||
@@ -58,7 +58,6 @@
|
||||
#define MAX_NUM_UNKNOWN_EXTS 250
|
||||
#endif
|
||||
|
||||
|
||||
enum layer_type {
|
||||
VK_LAYER_TYPE_INSTANCE_EXPLICIT = 0x1,
|
||||
VK_LAYER_TYPE_INSTANCE_IMPLICIT = 0x2,
|
||||
@@ -82,15 +81,13 @@ static const char UTF8_THREE_BYTE_MASK = 0xF8;
|
||||
static const char UTF8_DATA_BYTE_CODE = 0x80;
|
||||
static const char UTF8_DATA_BYTE_MASK = 0xC0;
|
||||
|
||||
static const char std_validation_names[7][VK_MAX_EXTENSION_NAME_SIZE] = {
|
||||
"VK_LAYER_GOOGLE_threading", "VK_LAYER_LUNARG_parameter_validation",
|
||||
"VK_LAYER_LUNARG_object_tracker", "VK_LAYER_LUNARG_image",
|
||||
"VK_LAYER_LUNARG_core_validation", "VK_LAYER_LUNARG_swapchain",
|
||||
"VK_LAYER_GOOGLE_unique_objects"};
|
||||
static const char std_validation_names[6][VK_MAX_EXTENSION_NAME_SIZE] = {
|
||||
"VK_LAYER_GOOGLE_threading", "VK_LAYER_LUNARG_parameter_validation", "VK_LAYER_LUNARG_object_tracker",
|
||||
"VK_LAYER_LUNARG_core_validation", "VK_LAYER_LUNARG_swapchain", "VK_LAYER_GOOGLE_unique_objects"};
|
||||
|
||||
struct VkStructureHeader {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
const void *pNext;
|
||||
};
|
||||
|
||||
// form of all dynamic lists/arrays
|
||||
@@ -137,7 +134,7 @@ struct loader_layer_functions {
|
||||
struct loader_layer_properties {
|
||||
VkLayerProperties info;
|
||||
enum layer_type type;
|
||||
uint32_t interface_version; // PFN_vkNegotiateLoaderLayerInterfaceVersion
|
||||
uint32_t interface_version; // PFN_vkNegotiateLoaderLayerInterfaceVersion
|
||||
char lib_name[MAX_STRING_SIZE];
|
||||
loader_platform_dl_handle lib_handle;
|
||||
struct loader_layer_functions functions;
|
||||
@@ -156,17 +153,16 @@ struct loader_layer_list {
|
||||
struct loader_dispatch_hash_list {
|
||||
size_t capacity;
|
||||
uint32_t count;
|
||||
uint32_t *index; // index into the dev_ext dispatch table
|
||||
uint32_t *index; // index into the dev_ext dispatch table
|
||||
};
|
||||
|
||||
|
||||
// loader_dispatch_hash_entry and loader_dev_ext_dispatch_table.dev_ext have
|
||||
// one to one correspondence; one loader_dispatch_hash_entry for one dev_ext
|
||||
// dispatch entry.
|
||||
// Also have a one to one correspondence with functions in dev_ext_trampoline.c
|
||||
struct loader_dispatch_hash_entry {
|
||||
char *func_name;
|
||||
struct loader_dispatch_hash_list list; // to handle hashing collisions
|
||||
struct loader_dispatch_hash_list list; // to handle hashing collisions
|
||||
};
|
||||
|
||||
typedef void(VKAPI_PTR *PFN_vkDevExt)(VkDevice device);
|
||||
@@ -182,8 +178,8 @@ struct loader_dev_dispatch_table {
|
||||
// per CreateDevice structure
|
||||
struct loader_device {
|
||||
struct loader_dev_dispatch_table loader_dispatch;
|
||||
VkDevice chain_device; // device object from the dispatch chain
|
||||
VkDevice icd_device; // device object from the icd
|
||||
VkDevice chain_device; // device object from the dispatch chain
|
||||
VkDevice icd_device; // device object from the icd
|
||||
struct loader_physical_device_term *phys_dev_term;
|
||||
|
||||
struct loader_layer_list activated_layer_list;
|
||||
@@ -193,159 +189,57 @@ struct loader_device {
|
||||
struct loader_device *next;
|
||||
};
|
||||
|
||||
/* per ICD structure */
|
||||
// Per ICD information
|
||||
|
||||
// Per ICD structure
|
||||
struct loader_icd_term {
|
||||
// pointers to find other structs
|
||||
const struct loader_scanned_icd *scanned_icd;
|
||||
const struct loader_instance *this_instance;
|
||||
struct loader_device *logical_device_list;
|
||||
VkInstance instance; // instance object from the icd
|
||||
PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
|
||||
PFN_vkDestroyInstance DestroyInstance;
|
||||
PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
|
||||
PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures;
|
||||
PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties;
|
||||
PFN_vkGetPhysicalDeviceImageFormatProperties
|
||||
GetPhysicalDeviceImageFormatProperties;
|
||||
PFN_vkCreateDevice CreateDevice;
|
||||
PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
|
||||
PFN_vkGetPhysicalDeviceQueueFamilyProperties
|
||||
GetPhysicalDeviceQueueFamilyProperties;
|
||||
PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties;
|
||||
PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
|
||||
PFN_vkGetPhysicalDeviceSparseImageFormatProperties
|
||||
GetPhysicalDeviceSparseImageFormatProperties;
|
||||
// WSI extensions
|
||||
PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR;
|
||||
PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
|
||||
GetPhysicalDeviceSurfaceCapabilitiesKHR;
|
||||
PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR;
|
||||
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR
|
||||
GetPhysicalDeviceSurfacePresentModesKHR;
|
||||
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||
PFN_vkCreateWin32SurfaceKHR CreateWin32SurfaceKHR;
|
||||
PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR
|
||||
GetPhysicalDeviceWin32PresentationSupportKHR;
|
||||
#endif
|
||||
#ifdef VK_USE_PLATFORM_MIR_KHR
|
||||
PFN_vkCreateMirSurfaceKHR CreateMirSurfaceKHR;
|
||||
PFN_vkGetPhysicalDeviceMirPresentationSupportKHR
|
||||
GetPhysicalDeviceMirPresentationSupportKHR;
|
||||
#endif
|
||||
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||
PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR;
|
||||
PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR
|
||||
GetPhysicalDeviceWaylandPresentationSupportKHR;
|
||||
#endif
|
||||
#ifdef VK_USE_PLATFORM_XCB_KHR
|
||||
PFN_vkCreateXcbSurfaceKHR CreateXcbSurfaceKHR;
|
||||
PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR
|
||||
GetPhysicalDeviceXcbPresentationSupportKHR;
|
||||
#endif
|
||||
#ifdef VK_USE_PLATFORM_XLIB_KHR
|
||||
PFN_vkCreateXlibSurfaceKHR CreateXlibSurfaceKHR;
|
||||
PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR
|
||||
GetPhysicalDeviceXlibPresentationSupportKHR;
|
||||
#endif
|
||||
PFN_vkGetPhysicalDeviceDisplayPropertiesKHR
|
||||
GetPhysicalDeviceDisplayPropertiesKHR;
|
||||
PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR
|
||||
GetPhysicalDeviceDisplayPlanePropertiesKHR;
|
||||
PFN_vkGetDisplayPlaneSupportedDisplaysKHR
|
||||
GetDisplayPlaneSupportedDisplaysKHR;
|
||||
PFN_vkGetDisplayModePropertiesKHR GetDisplayModePropertiesKHR;
|
||||
PFN_vkCreateDisplayModeKHR CreateDisplayModeKHR;
|
||||
PFN_vkGetDisplayPlaneCapabilitiesKHR GetDisplayPlaneCapabilitiesKHR;
|
||||
PFN_vkCreateDisplayPlaneSurfaceKHR CreateDisplayPlaneSurfaceKHR;
|
||||
PFN_vkDestroySurfaceKHR DestroySurfaceKHR;
|
||||
PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
|
||||
PFN_vkCreateSharedSwapchainsKHR CreateSharedSwapchainsKHR;
|
||||
|
||||
// KHR_get_physical_device_properties2
|
||||
PFN_vkGetPhysicalDeviceFeatures2KHR GetPhysicalDeviceFeatures2KHR;
|
||||
PFN_vkGetPhysicalDeviceProperties2KHR GetPhysicalDeviceProperties2KHR;
|
||||
PFN_vkGetPhysicalDeviceFormatProperties2KHR
|
||||
GetPhysicalDeviceFormatProperties2KHR;
|
||||
PFN_vkGetPhysicalDeviceImageFormatProperties2KHR
|
||||
GetPhysicalDeviceImageFormatProperties2KHR;
|
||||
PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR
|
||||
GetPhysicalDeviceQueueFamilyProperties2KHR;
|
||||
PFN_vkGetPhysicalDeviceMemoryProperties2KHR
|
||||
GetPhysicalDeviceMemoryProperties2KHR;
|
||||
PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR
|
||||
GetPhysicalDeviceSparseImageFormatProperties2KHR;
|
||||
|
||||
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
|
||||
// EXT_acquire_xlib_display
|
||||
PFN_vkAcquireXlibDisplayEXT AcquireXlibDisplayEXT;
|
||||
PFN_vkGetRandROutputDisplayEXT GetRandROutputDisplayEXT;
|
||||
#endif
|
||||
|
||||
// EXT_debug_report
|
||||
PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallbackEXT;
|
||||
PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallbackEXT;
|
||||
PFN_vkDebugReportMessageEXT DebugReportMessageEXT;
|
||||
|
||||
// EXT_debug_marker (items needing a trampoline/terminator)
|
||||
PFN_vkDebugMarkerSetObjectTagEXT DebugMarkerSetObjectTagEXT;
|
||||
PFN_vkDebugMarkerSetObjectNameEXT DebugMarkerSetObjectNameEXT;
|
||||
|
||||
// EXT_direct_mode_display
|
||||
PFN_vkReleaseDisplayEXT ReleaseDisplayEXT;
|
||||
|
||||
// EXT_display_surface_counter
|
||||
PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT
|
||||
GetPhysicalDeviceSurfaceCapabilities2EXT;
|
||||
|
||||
// NV_external_memory_capabilities
|
||||
PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV
|
||||
GetPhysicalDeviceExternalImageFormatPropertiesNV;
|
||||
|
||||
// NVX_device_generated_commands
|
||||
PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX
|
||||
GetPhysicalDeviceGeneratedCommandsPropertiesNVX;
|
||||
VkInstance instance; // instance object from the icd
|
||||
struct loader_icd_term_dispatch dispatch;
|
||||
|
||||
struct loader_icd_term *next;
|
||||
|
||||
PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS];
|
||||
PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS];
|
||||
};
|
||||
|
||||
// per ICD library structure
|
||||
// Per ICD library structure
|
||||
struct loader_icd_tramp_list {
|
||||
size_t capacity;
|
||||
uint32_t count;
|
||||
struct loader_scanned_icd *scanned_list;
|
||||
};
|
||||
|
||||
union loader_instance_extension_enables {
|
||||
struct {
|
||||
uint8_t khr_get_physical_device_properties2 : 1;
|
||||
uint8_t ext_acquire_xlib_display : 1;
|
||||
uint8_t ext_debug_report : 1;
|
||||
uint8_t ext_direct_mode_display : 1;
|
||||
uint8_t ext_display_surface_counter : 1;
|
||||
uint8_t nv_external_memory_capabilities : 1;
|
||||
};
|
||||
uint64_t padding[4];
|
||||
};
|
||||
|
||||
struct loader_instance_dispatch_table {
|
||||
VkLayerInstanceDispatchTable layer_inst_disp; // must be first entry in structure
|
||||
VkLayerInstanceDispatchTable layer_inst_disp; // must be first entry in structure
|
||||
|
||||
// Physical device functions unknown to the loader
|
||||
PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS];
|
||||
PFN_PhysDevExt phys_dev_ext[MAX_NUM_UNKNOWN_EXTS];
|
||||
};
|
||||
|
||||
// per instance structure
|
||||
// Per instance structure
|
||||
struct loader_instance {
|
||||
struct loader_instance_dispatch_table *disp; // must be first entry in structure
|
||||
struct loader_instance_dispatch_table *disp; // must be first entry in structure
|
||||
|
||||
// We need to manually track physical devices over time. If the user
|
||||
// re-queries the information, we don't want to delete old data or
|
||||
// create new data unless necessary.
|
||||
uint32_t total_gpu_count;
|
||||
uint32_t phys_dev_count_term;
|
||||
struct loader_physical_device_term **phys_devs_term;
|
||||
uint32_t phys_dev_count_tramp;
|
||||
struct loader_physical_device_tramp **phys_devs_tramp;
|
||||
|
||||
// We also need to manually track physical device groups, but we don't need
|
||||
// loader specific structures since we have that content in the physical
|
||||
// device stored internal to the public structures.
|
||||
uint32_t phys_dev_group_count_term;
|
||||
struct VkPhysicalDeviceGroupPropertiesKHX **phys_dev_groups_term;
|
||||
uint32_t phys_dev_group_count_tramp;
|
||||
struct VkPhysicalDeviceGroupPropertiesKHX **phys_dev_groups_tramp;
|
||||
|
||||
struct loader_instance *next;
|
||||
|
||||
uint32_t total_icd_count;
|
||||
@@ -360,9 +254,9 @@ struct loader_instance {
|
||||
struct loader_layer_list instance_layer_list;
|
||||
struct loader_layer_list activated_layer_list;
|
||||
bool activated_layers_are_std_val;
|
||||
VkInstance instance; // layers/ICD instance returned to trampoline
|
||||
VkInstance instance; // layers/ICD instance returned to trampoline
|
||||
|
||||
struct loader_extension_list ext_list; // icds and loaders extensions
|
||||
struct loader_extension_list ext_list; // icds and loaders extensions
|
||||
union loader_instance_extension_enables enabled_known_extensions;
|
||||
|
||||
VkLayerDbgFunctionNode *DbgFunctionHead;
|
||||
@@ -394,32 +288,32 @@ struct loader_instance {
|
||||
bool wsi_display_enabled;
|
||||
};
|
||||
|
||||
/* VkPhysicalDevice requires special treatment by loader. Firstly, terminator
|
||||
* code must be able to get the struct loader_icd_term to call into the proper
|
||||
* driver (multiple ICD/gpu case). This can be accomplished by wrapping the
|
||||
* created VkPhysicalDevice in loader terminate_EnumeratePhysicalDevices().
|
||||
* Secondly, the loader must be able to handle wrapped by layer VkPhysicalDevice
|
||||
* in trampoline code. This implies, that the loader trampoline code must also
|
||||
* wrap the VkPhysicalDevice object in trampoline code. Thus, loader has to
|
||||
* wrap the VkPhysicalDevice created object twice. In trampoline code it can't
|
||||
* rely on the terminator object wrapping since a layer may also wrap. Since
|
||||
* trampoline code wraps the VkPhysicalDevice this means all loader trampoline
|
||||
* code that passes a VkPhysicalDevice should unwrap it. */
|
||||
// VkPhysicalDevice requires special treatment by loader. Firstly, terminator
|
||||
// code must be able to get the struct loader_icd_term to call into the proper
|
||||
// driver (multiple ICD/gpu case). This can be accomplished by wrapping the
|
||||
// created VkPhysicalDevice in loader terminate_EnumeratePhysicalDevices().
|
||||
// Secondly, the loader must be able to handle wrapped by layer VkPhysicalDevice
|
||||
// in trampoline code. This implies, that the loader trampoline code must also
|
||||
// wrap the VkPhysicalDevice object in trampoline code. Thus, loader has to
|
||||
// wrap the VkPhysicalDevice created object twice. In trampoline code it can't
|
||||
// rely on the terminator object wrapping since a layer may also wrap. Since
|
||||
// trampoline code wraps the VkPhysicalDevice this means all loader trampoline
|
||||
// code that passes a VkPhysicalDevice should unwrap it.
|
||||
|
||||
/* per enumerated PhysicalDevice structure, used to wrap in trampoline code and
|
||||
also same structure used to wrap in terminator code */
|
||||
// Per enumerated PhysicalDevice structure, used to wrap in trampoline code and
|
||||
// also same structure used to wrap in terminator code
|
||||
struct loader_physical_device_tramp {
|
||||
struct loader_instance_dispatch_table *disp; // must be first entry in structure
|
||||
struct loader_instance_dispatch_table *disp; // must be first entry in structure
|
||||
struct loader_instance *this_instance;
|
||||
VkPhysicalDevice phys_dev; // object from layers/loader terminator
|
||||
VkPhysicalDevice phys_dev; // object from layers/loader terminator
|
||||
};
|
||||
|
||||
/* per enumerated PhysicalDevice structure, used to wrap in terminator code */
|
||||
// Per enumerated PhysicalDevice structure, used to wrap in terminator code
|
||||
struct loader_physical_device_term {
|
||||
struct loader_instance_dispatch_table *disp; // must be first entry in structure
|
||||
struct loader_instance_dispatch_table *disp; // must be first entry in structure
|
||||
struct loader_icd_term *this_icd_term;
|
||||
uint8_t icd_index;
|
||||
VkPhysicalDevice phys_dev; // object from ICD
|
||||
VkPhysicalDevice phys_dev; // object from ICD
|
||||
};
|
||||
|
||||
struct loader_struct {
|
||||
@@ -434,41 +328,29 @@ struct loader_scanned_icd {
|
||||
PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
|
||||
PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr;
|
||||
PFN_vkCreateInstance CreateInstance;
|
||||
PFN_vkEnumerateInstanceExtensionProperties
|
||||
EnumerateInstanceExtensionProperties;
|
||||
PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties;
|
||||
};
|
||||
|
||||
static inline struct loader_instance *loader_instance(VkInstance instance) {
|
||||
return (struct loader_instance *)instance;
|
||||
}
|
||||
static inline struct loader_instance *loader_instance(VkInstance instance) { return (struct loader_instance *)instance; }
|
||||
|
||||
static inline VkPhysicalDevice
|
||||
loader_unwrap_physical_device(VkPhysicalDevice physicalDevice) {
|
||||
struct loader_physical_device_tramp *phys_dev =
|
||||
(struct loader_physical_device_tramp *)physicalDevice;
|
||||
static inline VkPhysicalDevice loader_unwrap_physical_device(VkPhysicalDevice physicalDevice) {
|
||||
struct loader_physical_device_tramp *phys_dev = (struct loader_physical_device_tramp *)physicalDevice;
|
||||
return phys_dev->phys_dev;
|
||||
}
|
||||
|
||||
static inline void loader_set_dispatch(void *obj, const void *data) {
|
||||
*((const void **)obj) = data;
|
||||
}
|
||||
static inline void loader_set_dispatch(void *obj, const void *data) { *((const void **)obj) = data; }
|
||||
|
||||
static inline VkLayerDispatchTable *loader_get_dispatch(const void *obj) {
|
||||
return *((VkLayerDispatchTable **)obj);
|
||||
}
|
||||
static inline VkLayerDispatchTable *loader_get_dispatch(const void *obj) { return *((VkLayerDispatchTable **)obj); }
|
||||
|
||||
static inline struct loader_dev_dispatch_table *
|
||||
loader_get_dev_dispatch(const void *obj) {
|
||||
static inline struct loader_dev_dispatch_table *loader_get_dev_dispatch(const void *obj) {
|
||||
return *((struct loader_dev_dispatch_table **)obj);
|
||||
}
|
||||
|
||||
static inline VkLayerInstanceDispatchTable *
|
||||
loader_get_instance_layer_dispatch(const void *obj) {
|
||||
static inline VkLayerInstanceDispatchTable *loader_get_instance_layer_dispatch(const void *obj) {
|
||||
return *((VkLayerInstanceDispatchTable **)obj);
|
||||
}
|
||||
|
||||
static inline struct loader_instance_dispatch_table *
|
||||
loader_get_instance_dispatch(const void *obj) {
|
||||
static inline struct loader_instance_dispatch_table *loader_get_instance_dispatch(const void *obj) {
|
||||
return *((struct loader_instance_dispatch_table **)obj);
|
||||
}
|
||||
|
||||
@@ -482,13 +364,12 @@ static inline void loader_init_dispatch(void *obj, const void *data) {
|
||||
loader_set_dispatch(obj, data);
|
||||
}
|
||||
|
||||
/* global variables used across files */
|
||||
// Global variables used across files
|
||||
extern struct loader_struct loader;
|
||||
extern THREAD_LOCAL_DECL struct loader_instance *tls_instance;
|
||||
extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_init);
|
||||
extern loader_platform_thread_mutex loader_lock;
|
||||
extern loader_platform_thread_mutex loader_json_lock;
|
||||
extern const VkLayerInstanceDispatchTable instance_disp;
|
||||
extern const char *std_validation_str;
|
||||
|
||||
struct loader_msg_callback_map_entry {
|
||||
@@ -496,242 +377,105 @@ struct loader_msg_callback_map_entry {
|
||||
VkDebugReportCallbackEXT loader_obj;
|
||||
};
|
||||
|
||||
/* helper function definitions */
|
||||
void *loader_instance_heap_alloc(const struct loader_instance *instance,
|
||||
size_t size,
|
||||
VkSystemAllocationScope allocationScope);
|
||||
void loader_instance_heap_free(const struct loader_instance *instance,
|
||||
void *pMemory);
|
||||
void *loader_instance_heap_realloc(const struct loader_instance *instance,
|
||||
void *pMemory, size_t orig_size, size_t size,
|
||||
// Helper function definitions
|
||||
void *loader_instance_heap_alloc(const struct loader_instance *instance, size_t size, VkSystemAllocationScope allocationScope);
|
||||
void loader_instance_heap_free(const struct loader_instance *instance, void *pMemory);
|
||||
void *loader_instance_heap_realloc(const struct loader_instance *instance, void *pMemory, size_t orig_size, size_t size,
|
||||
VkSystemAllocationScope alloc_scope);
|
||||
void *loader_instance_tls_heap_alloc(size_t size);
|
||||
void loader_instance_tls_heap_free(void *pMemory);
|
||||
void *loader_device_heap_alloc(const struct loader_device *device, size_t size,
|
||||
VkSystemAllocationScope allocationScope);
|
||||
void *loader_device_heap_alloc(const struct loader_device *device, size_t size, VkSystemAllocationScope allocationScope);
|
||||
void loader_device_heap_free(const struct loader_device *device, void *pMemory);
|
||||
void *loader_device_heap_realloc(const struct loader_device *device,
|
||||
void *pMemory, size_t orig_size, size_t size,
|
||||
void *loader_device_heap_realloc(const struct loader_device *device, void *pMemory, size_t orig_size, size_t size,
|
||||
VkSystemAllocationScope alloc_scope);
|
||||
|
||||
void loader_log(const struct loader_instance *inst, VkFlags msg_type,
|
||||
int32_t msg_code, const char *format, ...);
|
||||
void loader_log(const struct loader_instance *inst, VkFlags msg_type, int32_t msg_code, const char *format, ...);
|
||||
|
||||
bool compare_vk_extension_properties(const VkExtensionProperties *op1,
|
||||
const VkExtensionProperties *op2);
|
||||
bool compare_vk_extension_properties(const VkExtensionProperties *op1, const VkExtensionProperties *op2);
|
||||
|
||||
VkResult loader_validate_layers(const struct loader_instance *inst,
|
||||
const uint32_t layer_count,
|
||||
const char *const *ppEnabledLayerNames,
|
||||
const struct loader_layer_list *list);
|
||||
VkResult loader_validate_layers(const struct loader_instance *inst, const uint32_t layer_count,
|
||||
const char *const *ppEnabledLayerNames, const struct loader_layer_list *list);
|
||||
|
||||
VkResult loader_validate_instance_extensions(
|
||||
const struct loader_instance *inst,
|
||||
const struct loader_extension_list *icd_exts,
|
||||
const struct loader_layer_list *instance_layer,
|
||||
const VkInstanceCreateInfo *pCreateInfo);
|
||||
VkResult loader_validate_instance_extensions(const struct loader_instance *inst, const struct loader_extension_list *icd_exts,
|
||||
const struct loader_layer_list *instance_layer,
|
||||
const VkInstanceCreateInfo *pCreateInfo);
|
||||
|
||||
void loader_initialize(void);
|
||||
VkResult loader_copy_layer_properties(const struct loader_instance *inst,
|
||||
struct loader_layer_properties *dst,
|
||||
VkResult loader_copy_layer_properties(const struct loader_instance *inst, struct loader_layer_properties *dst,
|
||||
struct loader_layer_properties *src);
|
||||
bool has_vk_extension_property_array(const VkExtensionProperties *vk_ext_prop,
|
||||
const uint32_t count,
|
||||
bool has_vk_extension_property_array(const VkExtensionProperties *vk_ext_prop, const uint32_t count,
|
||||
const VkExtensionProperties *ext_array);
|
||||
bool has_vk_extension_property(const VkExtensionProperties *vk_ext_prop,
|
||||
const struct loader_extension_list *ext_list);
|
||||
bool has_vk_extension_property(const VkExtensionProperties *vk_ext_prop, const struct loader_extension_list *ext_list);
|
||||
|
||||
VkResult loader_add_to_ext_list(const struct loader_instance *inst,
|
||||
struct loader_extension_list *ext_list,
|
||||
uint32_t prop_list_count,
|
||||
const VkExtensionProperties *props);
|
||||
VkResult
|
||||
loader_add_to_dev_ext_list(const struct loader_instance *inst,
|
||||
struct loader_device_extension_list *ext_list,
|
||||
const VkExtensionProperties *props,
|
||||
uint32_t entry_count, char **entrys);
|
||||
VkResult loader_add_to_ext_list(const struct loader_instance *inst, struct loader_extension_list *ext_list,
|
||||
uint32_t prop_list_count, const VkExtensionProperties *props);
|
||||
VkResult loader_add_to_dev_ext_list(const struct loader_instance *inst, struct loader_device_extension_list *ext_list,
|
||||
const VkExtensionProperties *props, uint32_t entry_count, char **entrys);
|
||||
VkResult loader_add_device_extensions(const struct loader_instance *inst,
|
||||
PFN_vkEnumerateDeviceExtensionProperties
|
||||
fpEnumerateDeviceExtensionProperties,
|
||||
VkPhysicalDevice physical_device,
|
||||
const char *lib_name,
|
||||
PFN_vkEnumerateDeviceExtensionProperties fpEnumerateDeviceExtensionProperties,
|
||||
VkPhysicalDevice physical_device, const char *lib_name,
|
||||
struct loader_extension_list *ext_list);
|
||||
VkResult loader_init_generic_list(const struct loader_instance *inst,
|
||||
struct loader_generic_list *list_info,
|
||||
size_t element_size);
|
||||
void loader_destroy_generic_list(const struct loader_instance *inst,
|
||||
struct loader_generic_list *list);
|
||||
void loader_destroy_layer_list(const struct loader_instance *inst,
|
||||
struct loader_device *device,
|
||||
VkResult loader_init_generic_list(const struct loader_instance *inst, struct loader_generic_list *list_info, size_t element_size);
|
||||
void loader_destroy_generic_list(const struct loader_instance *inst, struct loader_generic_list *list);
|
||||
void loader_destroy_layer_list(const struct loader_instance *inst, struct loader_device *device,
|
||||
struct loader_layer_list *layer_list);
|
||||
void loader_delete_layer_properties(const struct loader_instance *inst,
|
||||
struct loader_layer_list *layer_list);
|
||||
bool loader_find_layer_name_array(
|
||||
const char *name, uint32_t layer_count,
|
||||
const char layer_list[][VK_MAX_EXTENSION_NAME_SIZE]);
|
||||
VkResult loader_expand_layer_names(
|
||||
struct loader_instance *inst, const char *key_name, uint32_t expand_count,
|
||||
const char expand_names[][VK_MAX_EXTENSION_NAME_SIZE],
|
||||
uint32_t *layer_count, char const *const **ppp_layer_names);
|
||||
void loader_delete_layer_properties(const struct loader_instance *inst, struct loader_layer_list *layer_list);
|
||||
bool loader_find_layer_name_array(const char *name, uint32_t layer_count, const char layer_list[][VK_MAX_EXTENSION_NAME_SIZE]);
|
||||
VkResult loader_expand_layer_names(struct loader_instance *inst, const char *key_name, uint32_t expand_count,
|
||||
const char expand_names[][VK_MAX_EXTENSION_NAME_SIZE], uint32_t *layer_count,
|
||||
char const *const **ppp_layer_names);
|
||||
void loader_init_std_validation_props(struct loader_layer_properties *props);
|
||||
void loader_delete_shadow_dev_layer_names(const struct loader_instance *inst,
|
||||
const VkDeviceCreateInfo *orig,
|
||||
VkDeviceCreateInfo *ours);
|
||||
void loader_delete_shadow_inst_layer_names(const struct loader_instance *inst,
|
||||
const VkInstanceCreateInfo *orig,
|
||||
void loader_delete_shadow_inst_layer_names(const struct loader_instance *inst, const VkInstanceCreateInfo *orig,
|
||||
VkInstanceCreateInfo *ours);
|
||||
VkResult loader_add_to_layer_list(const struct loader_instance *inst,
|
||||
struct loader_layer_list *list,
|
||||
uint32_t prop_list_count,
|
||||
VkResult loader_add_to_layer_list(const struct loader_instance *inst, struct loader_layer_list *list, uint32_t prop_list_count,
|
||||
const struct loader_layer_properties *props);
|
||||
void loader_find_layer_name_add_list(
|
||||
const struct loader_instance *inst, const char *name,
|
||||
const enum layer_type type, const struct loader_layer_list *search_list,
|
||||
struct loader_layer_list *found_list);
|
||||
void loader_scanned_icd_clear(const struct loader_instance *inst,
|
||||
struct loader_icd_tramp_list *icd_tramp_list);
|
||||
VkResult loader_icd_scan(const struct loader_instance *inst,
|
||||
struct loader_icd_tramp_list *icd_tramp_list);
|
||||
void loader_layer_scan(const struct loader_instance *inst,
|
||||
struct loader_layer_list *instance_layers);
|
||||
void loader_implicit_layer_scan(const struct loader_instance *inst,
|
||||
struct loader_layer_list *instance_layers);
|
||||
VkResult loader_get_icd_loader_instance_extensions(
|
||||
const struct loader_instance *inst,
|
||||
struct loader_icd_tramp_list *icd_tramp_list,
|
||||
struct loader_extension_list *inst_exts);
|
||||
struct loader_icd_term *
|
||||
loader_get_icd_and_device(const VkDevice device,
|
||||
struct loader_device **found_dev,
|
||||
uint32_t *icd_index);
|
||||
void loader_init_dispatch_dev_ext(struct loader_instance *inst,
|
||||
struct loader_device *dev);
|
||||
void loader_find_layer_name_add_list(const struct loader_instance *inst, const char *name, const enum layer_type type,
|
||||
const struct loader_layer_list *search_list, struct loader_layer_list *found_list);
|
||||
void loader_scanned_icd_clear(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list);
|
||||
VkResult loader_icd_scan(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list);
|
||||
void loader_layer_scan(const struct loader_instance *inst, struct loader_layer_list *instance_layers);
|
||||
void loader_implicit_layer_scan(const struct loader_instance *inst, struct loader_layer_list *instance_layers);
|
||||
VkResult loader_get_icd_loader_instance_extensions(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list,
|
||||
struct loader_extension_list *inst_exts);
|
||||
struct loader_icd_term *loader_get_icd_and_device(const VkDevice device, struct loader_device **found_dev, uint32_t *icd_index);
|
||||
void loader_init_dispatch_dev_ext(struct loader_instance *inst, struct loader_device *dev);
|
||||
void *loader_dev_ext_gpa(struct loader_instance *inst, const char *funcName);
|
||||
void *loader_get_dev_ext_trampoline(uint32_t index);
|
||||
bool loader_phys_dev_ext_gpa(struct loader_instance *inst, const char *funcName,
|
||||
bool perform_checking, void **tramp_addr, void **term_addr);
|
||||
bool loader_phys_dev_ext_gpa(struct loader_instance *inst, const char *funcName, bool perform_checking, void **tramp_addr,
|
||||
void **term_addr);
|
||||
void *loader_get_phys_dev_ext_tramp(uint32_t index);
|
||||
void *loader_get_phys_dev_ext_termin(uint32_t index);
|
||||
struct loader_instance *loader_get_instance(const VkInstance instance);
|
||||
void loader_deactivate_layers(const struct loader_instance *instance,
|
||||
struct loader_device *device,
|
||||
struct loader_layer_list *list);
|
||||
struct loader_device *
|
||||
loader_create_logical_device(const struct loader_instance *inst,
|
||||
const VkAllocationCallbacks *pAllocator);
|
||||
void loader_add_logical_device(const struct loader_instance *inst,
|
||||
struct loader_icd_term *icd_term,
|
||||
void loader_deactivate_layers(const struct loader_instance *instance, struct loader_device *device, struct loader_layer_list *list);
|
||||
struct loader_device *loader_create_logical_device(const struct loader_instance *inst, const VkAllocationCallbacks *pAllocator);
|
||||
void loader_add_logical_device(const struct loader_instance *inst, struct loader_icd_term *icd_term,
|
||||
struct loader_device *found_dev);
|
||||
void loader_remove_logical_device(const struct loader_instance *inst,
|
||||
struct loader_icd_term *icd_term,
|
||||
struct loader_device *found_dev,
|
||||
const VkAllocationCallbacks *pAllocator);
|
||||
// NOTE: Outside of loader, this entry-point is only proivided for error
|
||||
void loader_remove_logical_device(const struct loader_instance *inst, struct loader_icd_term *icd_term,
|
||||
struct loader_device *found_dev, const VkAllocationCallbacks *pAllocator);
|
||||
// NOTE: Outside of loader, this entry-point is only provided for error
|
||||
// cleanup.
|
||||
void loader_destroy_logical_device(const struct loader_instance *inst,
|
||||
struct loader_device *dev,
|
||||
void loader_destroy_logical_device(const struct loader_instance *inst, struct loader_device *dev,
|
||||
const VkAllocationCallbacks *pAllocator);
|
||||
|
||||
VkResult
|
||||
loader_enable_instance_layers(struct loader_instance *inst,
|
||||
const VkInstanceCreateInfo *pCreateInfo,
|
||||
const struct loader_layer_list *instance_layers);
|
||||
void loader_deactivate_instance_layers(struct loader_instance *instance);
|
||||
VkResult loader_enable_instance_layers(struct loader_instance *inst, const VkInstanceCreateInfo *pCreateInfo,
|
||||
const struct loader_layer_list *instance_layers);
|
||||
|
||||
VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
struct loader_instance *inst,
|
||||
VkInstance *created_instance);
|
||||
VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator,
|
||||
struct loader_instance *inst, VkInstance *created_instance);
|
||||
|
||||
void loader_activate_instance_layer_extensions(struct loader_instance *inst,
|
||||
VkInstance created_inst);
|
||||
VkResult
|
||||
loader_enable_device_layers(const struct loader_instance *inst,
|
||||
struct loader_layer_list *activated_layer_list,
|
||||
const VkDeviceCreateInfo *pCreateInfo,
|
||||
const struct loader_layer_list *device_layers);
|
||||
void loader_activate_instance_layer_extensions(struct loader_instance *inst, VkInstance created_inst);
|
||||
|
||||
VkResult
|
||||
loader_create_device_chain(const struct loader_physical_device_tramp *pd,
|
||||
const VkDeviceCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
const struct loader_instance *inst,
|
||||
struct loader_device *dev);
|
||||
VkResult loader_create_device_chain(const struct loader_physical_device_tramp *pd, const VkDeviceCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator, const struct loader_instance *inst,
|
||||
struct loader_device *dev);
|
||||
|
||||
VkResult loader_validate_device_extensions(
|
||||
struct loader_physical_device_tramp *phys_dev,
|
||||
const struct loader_layer_list *activated_device_layers,
|
||||
const struct loader_extension_list *icd_exts,
|
||||
const VkDeviceCreateInfo *pCreateInfo);
|
||||
VkResult loader_validate_device_extensions(struct loader_physical_device_tramp *phys_dev,
|
||||
const struct loader_layer_list *activated_device_layers,
|
||||
const struct loader_extension_list *icd_exts, const VkDeviceCreateInfo *pCreateInfo);
|
||||
|
||||
VkResult setupLoaderTrampPhysDevs(VkInstance instance);
|
||||
VkResult setupLoaderTermPhysDevs(struct loader_instance *inst);
|
||||
|
||||
/* instance layer chain termination entrypoint definitions */
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
terminator_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkInstance *pInstance);
|
||||
VkStringErrorFlags vk_string_validate(const int max_length, const char *char_array);
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
terminator_DestroyInstance(VkInstance instance,
|
||||
const VkAllocationCallbacks *pAllocator);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
terminator_EnumeratePhysicalDevices(VkInstance instance,
|
||||
uint32_t *pPhysicalDeviceCount,
|
||||
VkPhysicalDevice *pPhysicalDevices);
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
terminator_GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice,
|
||||
VkPhysicalDeviceFeatures *pFeatures);
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
terminator_GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice,
|
||||
VkFormat format,
|
||||
VkFormatProperties *pFormatInfo);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
terminator_GetPhysicalDeviceImageFormatProperties(
|
||||
VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,
|
||||
VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags,
|
||||
VkImageFormatProperties *pImageFormatProperties);
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
terminator_GetPhysicalDeviceSparseImageFormatProperties(
|
||||
VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type,
|
||||
VkSampleCountFlagBits samples, VkImageUsageFlags usage,
|
||||
VkImageTiling tiling, uint32_t *pNumProperties,
|
||||
VkSparseImageFormatProperties *pProperties);
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
terminator_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice,
|
||||
VkPhysicalDeviceProperties *pProperties);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(
|
||||
VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pCount,
|
||||
VkExtensionProperties *pProperties);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
terminator_EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice,
|
||||
uint32_t *pCount,
|
||||
VkLayerProperties *pProperties);
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties(
|
||||
VkPhysicalDevice physicalDevice, uint32_t *pCount,
|
||||
VkQueueFamilyProperties *pProperties);
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceMemoryProperties(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkPhysicalDeviceMemoryProperties *pProperties);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
terminator_CreateDevice(VkPhysicalDevice gpu,
|
||||
const VkDeviceCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkDevice *pDevice);
|
||||
|
||||
VkStringErrorFlags vk_string_validate(const int max_length,
|
||||
const char *char_array);
|
||||
|
||||
#endif /* LOADER_H */
|
||||
#endif // LOADER_H
|
||||
|
||||
Reference in New Issue
Block a user