diff options
Diffstat (limited to 'thirdparty/vulkan/loader')
-rw-r--r-- | thirdparty/vulkan/loader/dxgi_loader.c | 23 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/dxgi_loader.h | 8 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/extension_manual.c | 147 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/extension_manual.h | 18 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/gpa_helper.h | 1 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/loader.c | 839 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/loader.h | 20 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/trampoline.c | 20 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/vk_dispatch_table_helper.h | 313 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/vk_layer_dispatch_table.h | 135 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/vk_loader_extensions.c | 1277 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/vk_loader_extensions.h | 12 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/vk_loader_platform.h | 64 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/vk_object_types.h | 103 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/wsi.c | 311 | ||||
-rw-r--r-- | thirdparty/vulkan/loader/wsi.h | 20 |
16 files changed, 2681 insertions, 630 deletions
diff --git a/thirdparty/vulkan/loader/dxgi_loader.c b/thirdparty/vulkan/loader/dxgi_loader.c deleted file mode 100644 index c2a3fa5638..0000000000 --- a/thirdparty/vulkan/loader/dxgi_loader.c +++ /dev/null @@ -1,23 +0,0 @@ -#include "dxgi_loader.h" - -#include <strsafe.h> - -static HMODULE load_dxgi_module() { - TCHAR systemPath[MAX_PATH] = ""; - GetSystemDirectory(systemPath, MAX_PATH); - StringCchCat(systemPath, MAX_PATH, TEXT("\\dxgi.dll")); - - return LoadLibrary(systemPath); -} - -typedef HRESULT (APIENTRY *PFN_CreateDXGIFactory1)(REFIID riid, void **ppFactory); - -HRESULT dyn_CreateDXGIFactory1(REFIID riid, void **ppFactory) { - PFN_CreateDXGIFactory1 fpCreateDXGIFactory1 = - (PFN_CreateDXGIFactory1)GetProcAddress(load_dxgi_module(), "CreateDXGIFactory1"); - - if (fpCreateDXGIFactory1 != NULL) - return fpCreateDXGIFactory1(riid, ppFactory); - - return DXGI_ERROR_NOT_FOUND; -}
\ No newline at end of file diff --git a/thirdparty/vulkan/loader/dxgi_loader.h b/thirdparty/vulkan/loader/dxgi_loader.h deleted file mode 100644 index 00daf08ed2..0000000000 --- a/thirdparty/vulkan/loader/dxgi_loader.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef DXGI_LOADER_H -#define DXGI_LOADER_H - -#include <dxgi1_2.h> - -HRESULT dyn_CreateDXGIFactory1(REFIID riid, void **ppFactory); - -#endif
\ No newline at end of file diff --git a/thirdparty/vulkan/loader/extension_manual.c b/thirdparty/vulkan/loader/extension_manual.c index b8118fdc8a..fab25813f5 100644 --- a/thirdparty/vulkan/loader/extension_manual.c +++ b/thirdparty/vulkan/loader/extension_manual.c @@ -37,78 +37,6 @@ // These functions, for whatever reason, require more complex changes than // can easily be automatically generated. -// ---- VK_KHR_device_group extension trampoline/terminators - -VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, - VkSurfaceCapabilities2KHR *pSurfaceCapabilities) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->GetPhysicalDeviceSurfaceCapabilities2KHR(unwrapped_phys_dev, pSurfaceInfo, pSurfaceCapabilities); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, - VkSurfaceCapabilities2KHR *pSurfaceCapabilities) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - VkIcdSurface *icd_surface = (VkIcdSurface *)(pSurfaceInfo->surface); - uint8_t icd_index = phys_dev_term->icd_index; - - if (icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR != NULL) { - VkBaseOutStructure *pNext = (VkBaseOutStructure *)pSurfaceCapabilities->pNext; - while (pNext != NULL) { - if ((int)pNext->sType == VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR) { - // Not all ICDs may be supporting VK_KHR_surface_protected_capabilities - // Initialize VkSurfaceProtectedCapabilitiesKHR.supportsProtected to false and - // if an ICD supports protected surfaces, it will reset it to true accordingly. - ((VkSurfaceProtectedCapabilitiesKHR *)pNext)->supportsProtected = VK_FALSE; - } - pNext = (VkBaseOutStructure *)pNext->pNext; - } - - // Pass the call to the driver, possibly unwrapping the ICD surface - if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) { - VkPhysicalDeviceSurfaceInfo2KHR info_copy = *pSurfaceInfo; - info_copy.surface = icd_surface->real_icd_surfaces[icd_index]; - return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev_term->phys_dev, &info_copy, - pSurfaceCapabilities); - } else { - return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev_term->phys_dev, pSurfaceInfo, - pSurfaceCapabilities); - } - } else { - // Emulate the call - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulating call in ICD \"%s\" using " - "vkGetPhysicalDeviceSurfaceCapabilitiesKHR", - icd_term->scanned_icd->lib_name); - - if (pSurfaceInfo->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulation found unrecognized structure type in " - "pSurfaceInfo->pNext - this struct will be ignored"); - } - - // Write to the VkSurfaceCapabilities2KHR struct - VkSurfaceKHR surface = pSurfaceInfo->surface; - if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) { - surface = icd_surface->real_icd_surfaces[icd_index]; - } - VkResult res = icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev_term->phys_dev, surface, - &pSurfaceCapabilities->surfaceCapabilities); - - if (pSurfaceCapabilities->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulation found unrecognized structure type in " - "pSurfaceCapabilities->pNext - this struct will be ignored"); - } - return res; - } -} - // ---- VK_NV_external_memory_capabilities extension trampoline/terminators VKAPI_ATTR VkResult VKAPI_CALL @@ -159,81 +87,6 @@ terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV( externalHandleType, pExternalImageFormatProperties); } -VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, - uint32_t *pSurfaceFormatCount, - VkSurfaceFormat2KHR *pSurfaceFormats) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - return disp->GetPhysicalDeviceSurfaceFormats2KHR(unwrapped_phys_dev, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats); -} - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, - uint32_t *pSurfaceFormatCount, - VkSurfaceFormat2KHR *pSurfaceFormats) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - - VkIcdSurface *icd_surface = (VkIcdSurface *)(pSurfaceInfo->surface); - uint8_t icd_index = phys_dev_term->icd_index; - - if (icd_term->dispatch.GetPhysicalDeviceSurfaceFormats2KHR != NULL) { - // Pass the call to the driver, possibly unwrapping the ICD surface - if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) { - VkPhysicalDeviceSurfaceInfo2KHR info_copy = *pSurfaceInfo; - info_copy.surface = icd_surface->real_icd_surfaces[icd_index]; - return icd_term->dispatch.GetPhysicalDeviceSurfaceFormats2KHR(phys_dev_term->phys_dev, &info_copy, pSurfaceFormatCount, - pSurfaceFormats); - } else { - return icd_term->dispatch.GetPhysicalDeviceSurfaceFormats2KHR(phys_dev_term->phys_dev, pSurfaceInfo, - pSurfaceFormatCount, pSurfaceFormats); - } - } else { - // Emulate the call - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, - "vkGetPhysicalDeviceSurfaceFormats2KHR: Emulating call in ICD \"%s\" using vkGetPhysicalDeviceSurfaceFormatsKHR", - icd_term->scanned_icd->lib_name); - - if (pSurfaceInfo->pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceSurfaceFormats2KHR: Emulation found unrecognized structure type in pSurfaceInfo->pNext " - "- this struct will be ignored"); - } - - VkSurfaceKHR surface = pSurfaceInfo->surface; - if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) { - surface = icd_surface->real_icd_surfaces[icd_index]; - } - - if (*pSurfaceFormatCount == 0 || pSurfaceFormats == NULL) { - // Write to pSurfaceFormatCount - return icd_term->dispatch.GetPhysicalDeviceSurfaceFormatsKHR(phys_dev_term->phys_dev, surface, pSurfaceFormatCount, - NULL); - } else { - // Allocate a temporary array for the output of the old function - VkSurfaceFormatKHR *formats = loader_stack_alloc(*pSurfaceFormatCount * sizeof(VkSurfaceFormatKHR)); - if (formats == NULL) { - return VK_ERROR_OUT_OF_HOST_MEMORY; - } - - VkResult res = icd_term->dispatch.GetPhysicalDeviceSurfaceFormatsKHR(phys_dev_term->phys_dev, surface, - pSurfaceFormatCount, formats); - for (uint32_t i = 0; i < *pSurfaceFormatCount; ++i) { - pSurfaceFormats[i].surfaceFormat = formats[i]; - if (pSurfaceFormats[i].pNext != NULL) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, - "vkGetPhysicalDeviceSurfaceFormats2KHR: Emulation found unrecognized structure type in " - "pSurfaceFormats[%d].pNext - this struct will be ignored", - i); - } - } - return res; - } - } -} - // ---- VK_EXT_display_surface_counter extension trampoline/terminators VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, diff --git a/thirdparty/vulkan/loader/extension_manual.h b/thirdparty/vulkan/loader/extension_manual.h index fe4287effb..b60a799eb2 100644 --- a/thirdparty/vulkan/loader/extension_manual.h +++ b/thirdparty/vulkan/loader/extension_manual.h @@ -39,24 +39,6 @@ terminator_GetPhysicalDeviceExternalImageFormatPropertiesNV( VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties); -VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, - VkSurfaceCapabilities2KHR* pSurfaceCapabilities); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2KHR( - VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, - VkSurfaceCapabilities2KHR* pSurfaceCapabilities); - -VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, - uint32_t* pSurfaceFormatCount, - VkSurfaceFormat2KHR* pSurfaceFormats); - -VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, - uint32_t* pSurfaceFormatCount, - VkSurfaceFormat2KHR* pSurfaceFormats); - VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilities2EXT* pSurfaceCapabilities); diff --git a/thirdparty/vulkan/loader/gpa_helper.h b/thirdparty/vulkan/loader/gpa_helper.h index 832b68c3ef..01dec6fa72 100644 --- a/thirdparty/vulkan/loader/gpa_helper.h +++ b/thirdparty/vulkan/loader/gpa_helper.h @@ -229,6 +229,7 @@ static inline void *globalGetProcAddr(const char *name) { if (!strcmp(name, "EnumerateInstanceExtensionProperties")) return vkEnumerateInstanceExtensionProperties; if (!strcmp(name, "EnumerateInstanceLayerProperties")) return vkEnumerateInstanceLayerProperties; if (!strcmp(name, "EnumerateInstanceVersion")) return vkEnumerateInstanceVersion; + if (!strcmp(name, "GetInstanceProcAddr")) return vkGetInstanceProcAddr; return NULL; } diff --git a/thirdparty/vulkan/loader/loader.c b/thirdparty/vulkan/loader/loader.c index c7cdb47122..418b88e30a 100644 --- a/thirdparty/vulkan/loader/loader.c +++ b/thirdparty/vulkan/loader/loader.c @@ -70,8 +70,12 @@ #include <initguid.h> #include <devpkey.h> #include <winternl.h> +#include <strsafe.h> +#include <dxgi1_6.h> #include "adapters.h" -#include "dxgi_loader.h" + +typedef HRESULT (APIENTRY *PFN_CreateDXGIFactory1)(REFIID riid, void **ppFactory); +static PFN_CreateDXGIFactory1 fpCreateDXGIFactory1; #endif // This is a CMake generated file with #defines for any functions/includes @@ -84,6 +88,10 @@ // Generated file containing all the extension data #include "vk_loader_extensions.c" +// Environment Variable information +#define VK_ICD_FILENAMES_ENV_VAR "VK_ICD_FILENAMES" +#define VK_LAYER_PATH_ENV_VAR "VK_LAYER_PATH" + // Override layer information #define VK_OVERRIDE_LAYER_NAME "VK_LAYER_LUNARG_override" @@ -121,12 +129,16 @@ enum loader_data_files_type { // additionally CreateDevice and DestroyDevice needs to be locked loader_platform_thread_mutex loader_lock; loader_platform_thread_mutex loader_json_lock; +loader_platform_thread_mutex loader_preload_icd_lock; -LOADER_PLATFORM_THREAD_ONCE_DECLARATION(once_init); +// A list of ICDs that gets initialized when the loader does its global initialization. This list should never be used by anything +// other than EnumerateInstanceExtensionProperties(), vkDestroyInstance, and loader_release(). This list does not change +// functionality, but the fact that the libraries already been loaded causes any call that needs to load ICD libraries to speed up +// significantly. This can have a huge impact when making repeated calls to vkEnumerateInstanceExtensionProperties and +// vkCreateInstance. +static struct loader_icd_tramp_list scanned_icds; -// This loader supports Vulkan API version 1.1 -uint32_t loader_major_version = 1; -uint32_t loader_minor_version = 2; +LOADER_PLATFORM_THREAD_ONCE_DECLARATION(once_init); void *loader_instance_heap_alloc(const struct loader_instance *instance, size_t size, VkSystemAllocationScope alloc_scope) { void *pMemory = NULL; @@ -400,7 +412,7 @@ void loader_log(const struct loader_instance *inst, VkFlags msg_type, int32_t ms } else if ((msg_type & LOADER_ERROR_BIT) != 0) { severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; } else if ((msg_type & LOADER_DEBUG_BIT) != 0) { - severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT; + severity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT; } if ((msg_type & LOADER_PERF_BIT) != 0) { @@ -876,7 +888,7 @@ VkResult loaderGetRegistryFiles(const struct loader_instance *inst, char *locati } if (is_driver) { - HRESULT hres = dyn_CreateDXGIFactory1(&IID_IDXGIFactory1, &dxgi_factory); + HRESULT hres = fpCreateDXGIFactory1(&IID_IDXGIFactory1, (void **)&dxgi_factory); if (hres != S_OK) { loader_log( inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, @@ -1078,11 +1090,11 @@ static size_t loader_platform_combine_path(char *dest, size_t len, ...) { // Given string of three part form "maj.min.pat" convert to a vulkan version number. static uint32_t loader_make_version(char *vers_str) { - uint32_t vers = 0, major = 0, minor = 0, patch = 0; + uint32_t major = 0, minor = 0, patch = 0; char *vers_tok; if (!vers_str) { - return vers; + return 0; } vers_tok = strtok(vers_str, ".\"\n\r"); @@ -1230,6 +1242,10 @@ void loaderDeleteLayerListAndProperties(const struct loader_instance *inst, stru loader_instance_heap_free(inst, layer_list->list[i].override_paths); layer_list->list[i].override_paths = NULL; } + if (NULL != layer_list->list[i].app_key_paths) { + loader_instance_heap_free(inst, layer_list->list[i].app_key_paths); + layer_list->list[i].app_key_paths = NULL; + } loader_destroy_generic_list(inst, (struct loader_generic_list *)&layer_list->list[i].instance_extension_list); dev_ext_list = &layer_list->list[i].device_extension_list; if (dev_ext_list->capacity > 0 && NULL != dev_ext_list->list) { @@ -1253,6 +1269,31 @@ void loaderDeleteLayerListAndProperties(const struct loader_instance *inst, stru } } +void loaderRemoveLayerInList(const struct loader_instance *inst, struct loader_layer_list *layer_list, uint32_t layer_to_remove) { + if (layer_list == NULL || layer_to_remove >= layer_list->count) { + return; + } + if (layer_list->list[layer_to_remove].type_flags & VK_LAYER_TYPE_FLAG_META_LAYER) { + // Delete the component layers + loader_instance_heap_free(inst, layer_list->list[layer_to_remove].component_layer_names); + loader_instance_heap_free(inst, layer_list->list[layer_to_remove].override_paths); + loader_instance_heap_free(inst, layer_list->list[layer_to_remove].blacklist_layer_names); + loader_instance_heap_free(inst, layer_list->list[layer_to_remove].app_key_paths); + } + + // Remove the current invalid meta-layer from the layer list. Use memmove since we are + // overlapping the source and destination addresses. + memmove(&layer_list->list[layer_to_remove], &layer_list->list[layer_to_remove + 1], + sizeof(struct loader_layer_properties) * (layer_list->count - 1 - layer_to_remove)); + + // Make sure to clear out the removed layer, in case new layers are added in the previous location + memset(&layer_list->list[layer_list->count - 1], 0, sizeof(struct loader_layer_properties)); + + // Decrement the count (because we now have one less) and decrement the loop index since we need to + // re-check this index. + layer_list->count--; +} + // Remove all layers in the layer list that are blacklisted by the override layer. // NOTE: This should only be called if an override layer is found and not expired. void loaderRemoveLayersInBlacklist(const struct loader_instance *inst, struct loader_layer_list *layer_list) { @@ -1925,9 +1966,10 @@ bool loaderAddMetaLayer(const struct loader_instance *inst, const struct loader_ // Search the source_list for any layer with a name that matches the given name and a type // that matches the given type. Add all matching layers to the target_list. // Do not add if found loader_layer_properties is already on the target_list. -void loaderAddLayerNameToList(const struct loader_instance *inst, const char *name, const enum layer_type_flags type_flags, - const struct loader_layer_list *source_list, struct loader_layer_list *target_list, - struct loader_layer_list *expanded_target_list) { +VkResult loaderAddLayerNameToList(const struct loader_instance *inst, const char *name, const enum layer_type_flags type_flags, + const struct loader_layer_list *source_list, struct loader_layer_list *target_list, + struct loader_layer_list *expanded_target_list) { + VkResult res = VK_SUCCESS; bool found = false; for (uint32_t i = 0; i < source_list->count; i++) { struct loader_layer_properties *source_prop = &source_list->list[i]; @@ -1948,9 +1990,17 @@ void loaderAddLayerNameToList(const struct loader_instance *inst, const char *na } } if (!found) { - loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "loaderAddLayerNameToList: Failed to find layer name %s to activate", - name); + if (strcmp(name, "VK_LAYER_LUNARG_standard_validation")) { + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "loaderAddLayerNameToList: Failed to find layer name %s to activate", name); + } else { + res = VK_ERROR_LAYER_NOT_PRESENT; + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "Layer VK_LAYER_LUNARG_standard_validation has been changed to VK_LAYER_KHRONOS_validation. Please use the " + "new version of the layer."); + } } + return res; } static VkExtensionProperties *get_extension_property(const char *name, const struct loader_extension_list *list) { @@ -2251,6 +2301,9 @@ static VkResult loader_scanned_icd_add(const struct loader_instance *inst, struc PFN_vkGetInstanceProcAddr fp_get_proc_addr; PFN_GetPhysicalDeviceProcAddr fp_get_phys_dev_proc_addr = NULL; PFN_vkNegotiateLoaderICDInterfaceVersion fp_negotiate_icd_version; +#if defined(VK_USE_PLATFORM_WIN32_KHR) + PFN_vk_icdEnumerateAdapterPhysicalDevices fp_enum_dxgi_adapter_phys_devs = NULL; +#endif struct loader_scanned_icd *new_scanned_icd; uint32_t interface_vers; VkResult res = VK_SUCCESS; @@ -2337,6 +2390,11 @@ static VkResult loader_scanned_icd_add(const struct loader_instance *inst, struc goto out; } fp_get_phys_dev_proc_addr = loader_platform_get_proc_address(handle, "vk_icdGetPhysicalDeviceProcAddr"); +#if defined(VK_USE_PLATFORM_WIN32_KHR) + if (interface_vers >= 6) { + fp_enum_dxgi_adapter_phys_devs = loader_platform_get_proc_address(handle, "vk_icdEnumerateAdapterPhysicalDevices"); + } +#endif } // check for enough capacity @@ -2362,6 +2420,9 @@ static VkResult loader_scanned_icd_add(const struct loader_instance *inst, struc new_scanned_icd->GetPhysicalDeviceProcAddr = fp_get_phys_dev_proc_addr; new_scanned_icd->EnumerateInstanceExtensionProperties = fp_get_inst_ext_props; new_scanned_icd->CreateInstance = fp_create_inst; +#if defined(VK_USE_PLATFORM_WIN32_KHR) + new_scanned_icd->EnumerateAdapterPhysicalDevices = fp_enum_dxgi_adapter_phys_devs; +#endif new_scanned_icd->interface_version = interface_vers; new_scanned_icd->lib_name = (char *)loader_instance_heap_alloc(inst, strlen(filename) + 1, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); @@ -2430,7 +2491,7 @@ void loader_initialize(void) { // initialize mutexes loader_platform_thread_create_mutex(&loader_lock); loader_platform_thread_create_mutex(&loader_json_lock); - + loader_platform_thread_create_mutex(&loader_preload_icd_lock); // initialize logging loader_debug_init(); @@ -2444,6 +2505,13 @@ void loader_initialize(void) { // This is needed to ensure that newer APIs are available right away // and not after the first call that has been statically linked LoadLibrary("gdi32.dll"); + + TCHAR systemPath[MAX_PATH] = ""; + GetSystemDirectory(systemPath, MAX_PATH); + StringCchCat(systemPath, MAX_PATH, TEXT("\\dxgi.dll")); + HMODULE dxgi_module = LoadLibrary(systemPath); + fpCreateDXGIFactory1 = dxgi_module == NULL ? NULL : + (PFN_CreateDXGIFactory1)GetProcAddress(dxgi_module, "CreateDXGIFactory1"); #endif } @@ -2454,9 +2522,38 @@ struct loader_data_files { }; void loader_release() { + // Guarantee release of the preloaded ICD libraries. This may have already been called in vkDestroyInstance. + loader_unload_preloaded_icds(); + // release mutexes loader_platform_thread_delete_mutex(&loader_lock); loader_platform_thread_delete_mutex(&loader_json_lock); + loader_platform_thread_delete_mutex(&loader_preload_icd_lock); +} + +// Preload the ICD libraries that are likely to be needed so we don't repeatedly load/unload them later +void loader_preload_icds(void) { + loader_platform_thread_lock_mutex(&loader_preload_icd_lock); + + // Already preloaded, skip loading again. + if (scanned_icds.scanned_list != NULL) { + loader_platform_thread_unlock_mutex(&loader_preload_icd_lock); + return; + } + + memset(&scanned_icds, 0, sizeof(scanned_icds)); + VkResult result = loader_icd_scan(NULL, &scanned_icds); + if (result != VK_SUCCESS) { + loader_scanned_icd_clear(NULL, &scanned_icds); + } + loader_platform_thread_unlock_mutex(&loader_preload_icd_lock); +} + +// Release the ICD libraries that were preloaded +void loader_unload_preloaded_icds(void) { + loader_platform_thread_lock_mutex(&loader_preload_icd_lock); + loader_scanned_icd_clear(NULL, &scanned_icds); + loader_platform_thread_unlock_mutex(&loader_preload_icd_lock); } // Get next file or dirname given a string list or registry key path @@ -2562,6 +2659,11 @@ static VkResult loader_get_json(const struct loader_instance *inst, const char * } json_buf[len] = '\0'; + // Can't be a valid json if the string is of length zero + if (len == 0) { + res = VK_ERROR_INITIALIZATION_FAILED; + goto out; + } // Parse text from file *json = cJSON_Parse(json_buf); if (*json == NULL) { @@ -2711,6 +2813,9 @@ static void VerifyAllMetaLayers(struct loader_instance *inst, struct loader_laye if (prop->blacklist_layer_names != NULL) { loader_instance_heap_free(inst, prop->blacklist_layer_names); } + if (prop->override_paths != NULL) { + loader_instance_heap_free(inst, prop->override_paths); + } // Remove the current invalid meta-layer from the layer list. Use memmove since we are // overlapping the source and destination addresses. @@ -2727,6 +2832,75 @@ static void VerifyAllMetaLayers(struct loader_instance *inst, struct loader_laye } } +// If the current working directory matches any app_key_path of the layers, remove all other override layers. +// Otherwise if no matching app_key was found, remove all but the global override layer, which has no app_key_path. +static void RemoveAllNonValidOverrideLayers(struct loader_instance *inst, struct loader_layer_list *instance_layers) { + if (instance_layers == NULL) { + return; + } + + char cur_path[MAX_STRING_SIZE]; + char *ret = loader_platform_executable_path(cur_path, sizeof(cur_path)); + if (ret == NULL) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "RemoveAllNonValidOverrideLayers: Failed to get executable path and name"); + return; + } + + // Find out if there is an override layer with same the app_key_path as the path to the current executable. + // If more than one is found, remove it and use the first layer + // Remove any layers which aren't global and do not have the same app_key_path as the path to the current executable. + bool found_active_override_layer = false; + int global_layer_index = -1; + for (uint32_t i = 0; i < instance_layers->count; i++) { + struct loader_layer_properties *props = &instance_layers->list[i]; + if (strcmp(props->info.layerName, VK_OVERRIDE_LAYER_NAME) == 0) { + if (props->num_app_key_paths > 0) { // not the global layer + for (uint32_t j = 0; j < props->num_app_key_paths; j++) { + if (strcmp(props->app_key_paths[j], cur_path) == 0) { + if (!found_active_override_layer) { + found_active_override_layer = true; + } else { + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "RemoveAllNonValidOverrideLayers: Multiple override layers where the same" + "path in app_keys was found. Using the first layer found"); + + // Remove duplicate active override layers that have the same app_key_path + loaderRemoveLayerInList(inst, instance_layers, i); + i--; + } + } + } + if (!found_active_override_layer) { + // Remove non-global override layers that don't have an app_key that matches cur_path + loaderRemoveLayerInList(inst, instance_layers, i); + i--; + } + } else { + if (global_layer_index == -1) { + global_layer_index = i; + } else { + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "RemoveAllNonValidOverrideLayers: Multiple global override layers " + "found. Using the first global layer found"); + loaderRemoveLayerInList(inst, instance_layers, i); + i--; + } + } + } + } + // Remove global layer if layer with same the app_key_path as the path to the current executable is found + if (found_active_override_layer && global_layer_index >= 0) { + loaderRemoveLayerInList(inst, instance_layers, global_layer_index); + } + // Should be at most 1 override layer in the list now. + if (found_active_override_layer) { + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "Using the override layer for app key %s", cur_path); + } else if (global_layer_index >= 0) { + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "Using the global override layer"); + } +} + // This structure is used to store the json file version // in a more manageable way. typedef struct { @@ -3128,6 +3302,7 @@ static VkResult loaderReadLayerJson(const struct loader_instance *inst, struct l char *vkNegotiateLoaderLayerInterfaceVersion = NULL; char *spec_version = NULL; char **entry_array = NULL; + cJSON *app_keys = NULL; // Layer interface functions // vkGetInstanceProcAddr @@ -3316,6 +3491,45 @@ static VkResult loaderReadLayerJson(const struct loader_instance *inst, struct l } } + props->num_app_key_paths = 0; + props->app_key_paths = NULL; + app_keys = cJSON_GetObjectItem(layer_node, "app_keys"); + if (app_keys != NULL) { + if (strcmp(name, VK_OVERRIDE_LAYER_NAME)) { + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "Layer %s contains app_keys, but any app_keys can only be provided by the override metalayer. " + "These will be ignored.", + name); + } else { + props->num_app_key_paths = cJSON_GetArraySize(app_keys); + + // Allocate the blacklist array + props->app_key_paths = loader_instance_heap_alloc(inst, sizeof(char[MAX_STRING_SIZE]) * props->num_app_key_paths, + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (props->app_key_paths == NULL) { + result = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + + // Copy the app_key_paths into the array + for (i = 0; i < (int)props->num_app_key_paths; ++i) { + cJSON *app_key_path = cJSON_GetArrayItem(app_keys, i); + if (app_key_path == NULL) { + continue; + } + temp = cJSON_Print(app_key_path); + if (temp == NULL) { + result = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + temp[strlen(temp) - 1] = '\0'; + strncpy(props->app_key_paths[i], temp + 1, MAX_STRING_SIZE - 1); + props->app_key_paths[i][MAX_STRING_SIZE - 1] = '\0'; + cJSON_Free(temp); + } + } + } + result = VK_SUCCESS; out: @@ -3332,12 +3546,17 @@ out: if (NULL != props->override_paths) { loader_instance_heap_free(inst, props->override_paths); } + if (NULL != props->app_key_paths) { + loader_instance_heap_free(inst, props->app_key_paths); + } props->num_blacklist_layers = 0; props->blacklist_layer_names = NULL; props->num_component_layers = 0; props->component_layer_names = NULL; props->num_override_paths = 0; props->override_paths = NULL; + props->num_app_key_paths = 0; + props->app_key_paths = NULL; } return result; @@ -3380,6 +3599,10 @@ static VkResult loaderAddLayerProperties(const struct loader_instance *inst, str layer_json_version json_version = {0, 0, 0}; char *vers_tok; cJSON *disable_environment = NULL; + // Make sure sure the top level json value is an object + if (!json || json->type != 6) { + goto out; + } item = cJSON_GetObjectItem(json, "file_format_version"); if (item == NULL) { goto out; @@ -3596,7 +3819,7 @@ out: } static VkResult AddDataFilesInPath(const struct loader_instance *inst, char *search_path, bool is_directory_list, - struct loader_data_files *out_files) { + struct loader_data_files *out_files, bool use_first_found_manifest) { VkResult vk_result = VK_SUCCESS; DIR *dir_stream = NULL; struct dirent *dir_entry; @@ -3678,6 +3901,9 @@ static VkResult AddDataFilesInPath(const struct loader_instance *inst, char *sea break; } } + if (use_first_found_manifest && out_files->count > 0) { + break; + } } out: @@ -3699,6 +3925,7 @@ static VkResult ReadDataFilesInSearchPaths(const struct loader_instance *inst, e char *search_path = NULL; char *cur_path_ptr = NULL; size_t rel_size = 0; + bool use_first_found_manifest = false; #ifndef _WIN32 bool xdgconfig_alloc = true; bool xdgdata_alloc = true; @@ -3828,6 +4055,10 @@ static VkResult ReadDataFilesInSearchPaths(const struct loader_instance *inst, e memcpy(cur_path_ptr, relative_location, rel_size); cur_path_ptr += rel_size; *cur_path_ptr++ = PATH_SEPARATOR; + // only for ICD manifests + if (env_override != NULL && strcmp(VK_ICD_FILENAMES_ENV_VAR, env_override) == 0) { + use_first_found_manifest = true; + } } CFRelease(ref); } @@ -3853,6 +4084,39 @@ static VkResult ReadDataFilesInSearchPaths(const struct loader_instance *inst, e #endif } + // Remove duplicate paths, or it would result in duplicate extensions, duplicate devices, etc. + // This uses minimal memory, but is O(N^2) on the number of paths. Expect only a few paths. + char path_sep_str[2] = {PATH_SEPARATOR, '\0'}; + size_t search_path_updated_size = strlen(search_path); + for (size_t first = 0; first < search_path_updated_size;) { + // If this is an empty path, erase it + if (search_path[first] == PATH_SEPARATOR) { + memmove(&search_path[first], &search_path[first + 1], search_path_updated_size - first + 1); + search_path_updated_size -= 1; + continue; + } + + size_t first_end = first + 1; + first_end += strcspn(&search_path[first_end], path_sep_str); + for (size_t second = first_end + 1; second < search_path_updated_size;) { + size_t second_end = second + 1; + second_end += strcspn(&search_path[second_end], path_sep_str); + if (first_end - first == second_end - second && + !strncmp(&search_path[first], &search_path[second], second_end - second)) { + // Found duplicate. Include PATH_SEPARATOR in second_end, then erase it from search_path. + if (search_path[second_end] == PATH_SEPARATOR) { + second_end++; + } + memmove(&search_path[second], &search_path[second_end], search_path_updated_size - second_end + 1); + search_path_updated_size -= second_end - second; + } else { + second = second_end + 1; + } + } + first = first_end + 1; + } + search_path_size = search_path_updated_size; + // Print out the paths being searched if debugging is enabled if (search_path_size > 0) { loader_log(inst, VK_DEBUG_REPORT_DEBUG_BIT_EXT, 0, @@ -3860,7 +4124,7 @@ static VkResult ReadDataFilesInSearchPaths(const struct loader_instance *inst, e } // Now, parse the paths and add any manifest files found in them. - vk_result = AddDataFilesInPath(inst, search_path, is_directory_list, out_files); + vk_result = AddDataFilesInPath(inst, search_path, is_directory_list, out_files, use_first_found_manifest); if (NULL != override_path) { *override_active = true; @@ -4096,7 +4360,7 @@ static VkResult ReadDataFilesInRegistry(const struct loader_instance *inst, enum } // Now, parse the paths and add any manifest files found in them. - vk_result = AddDataFilesInPath(inst, search_path, false, out_files); + vk_result = AddDataFilesInPath(inst, search_path, false, out_files, false); out: @@ -4216,14 +4480,12 @@ VkResult loader_icd_scan(const struct loader_instance *inst, struct loader_icd_t if (VK_SUCCESS != res) { goto out; } - // Get a list of manifest files for ICDs - res = loaderGetDataFiles(inst, LOADER_DATA_FILE_MANIFEST_ICD, true, "VK_ICD_FILENAMES", NULL, VK_DRIVERS_INFO_REGISTRY_LOC, - VK_DRIVERS_INFO_RELATIVE_DIR, &manifest_files); + res = loaderGetDataFiles(inst, LOADER_DATA_FILE_MANIFEST_ICD, true, VK_ICD_FILENAMES_ENV_VAR, NULL, + VK_DRIVERS_INFO_REGISTRY_LOC, VK_DRIVERS_INFO_RELATIVE_DIR, &manifest_files); if (VK_SUCCESS != res || manifest_files.count == 0) { goto out; } - loader_platform_thread_lock_mutex(&loader_json_lock); lockedMutex = true; for (uint32_t i = 0; i < manifest_files.count; i++) { @@ -4244,6 +4506,7 @@ VkResult loader_icd_scan(const struct loader_instance *inst, struct loader_icd_t res = temp_res; } if (temp_res == VK_ERROR_OUT_OF_HOST_MEMORY) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; break; } else { continue; @@ -4486,12 +4749,16 @@ void loaderScanForLayers(struct loader_instance *inst, struct loader_layer_list VkResult local_res = loaderAddLayerProperties(inst, instance_layers, json, true, file_str); cJSON_Delete(json); - if (VK_SUCCESS != local_res) { + // If the error is anything other than out of memory we still want to try to load the other layers + if (VK_ERROR_OUT_OF_HOST_MEMORY == local_res) { goto out; } } } + // Remove any extraneous override layers. + RemoveAllNonValidOverrideLayers(inst, instance_layers); + // Check to see if the override layer is present, and use it's override paths. for (int32_t i = 0; i < (int32_t)instance_layers->count; i++) { struct loader_layer_properties *prop = &instance_layers->list[i]; @@ -4519,7 +4786,7 @@ void loaderScanForLayers(struct loader_instance *inst, struct loader_layer_list } // Get a list of manifest files for explicit layers - if (VK_SUCCESS != loaderGetDataFiles(inst, LOADER_DATA_FILE_MANIFEST_LAYER, true, "VK_LAYER_PATH", override_paths, + if (VK_SUCCESS != loaderGetDataFiles(inst, LOADER_DATA_FILE_MANIFEST_LAYER, true, VK_LAYER_PATH_ENV_VAR, override_paths, VK_ELAYERS_INFO_REGISTRY_LOC, VK_ELAYERS_INFO_RELATIVE_DIR, &manifest_files)) { goto out; } @@ -4631,6 +4898,9 @@ void loaderScanForImplicitLayers(struct loader_instance *inst, struct loader_lay } } + // Remove any extraneous override layers. + RemoveAllNonValidOverrideLayers(inst, instance_layers); + // Check to see if either the override layer is present, or another implicit meta-layer. // Each of these may require explicit layers to be enabled at this time. for (int32_t i = 0; i < (int32_t)instance_layers->count; i++) { @@ -4667,7 +4937,7 @@ void loaderScanForImplicitLayers(struct loader_instance *inst, struct loader_lay // explicit layer info as well. Not to worry, though, all explicit layers not included // in the override layer will be removed below in loaderRemoveLayersInBlacklist(). if (override_layer_valid || implicit_metalayer_present) { - if (VK_SUCCESS != loaderGetDataFiles(inst, LOADER_DATA_FILE_MANIFEST_LAYER, true, "VK_LAYER_PATH", override_paths, + if (VK_SUCCESS != loaderGetDataFiles(inst, LOADER_DATA_FILE_MANIFEST_LAYER, true, VK_LAYER_PATH_ENV_VAR, override_paths, VK_ELAYERS_INFO_REGISTRY_LOC, VK_ELAYERS_INFO_RELATIVE_DIR, &manifest_files)) { goto out; } @@ -4689,6 +4959,7 @@ void loaderScanForImplicitLayers(struct loader_instance *inst, struct loader_lay res = loaderAddLayerProperties(inst, instance_layers, json, true, file_str); loader_instance_heap_free(inst, file_str); + manifest_files.filename_list[i] = NULL; cJSON_Delete(json); if (VK_ERROR_OUT_OF_HOST_MEMORY == res) { @@ -4713,6 +4984,11 @@ out: if (NULL != override_paths) { loader_instance_heap_free(inst, override_paths); } + for (uint32_t i = 0; i < manifest_files.count; i++) { + if (NULL != manifest_files.filename_list[i]) { + loader_instance_heap_free(inst, manifest_files.filename_list[i]); + } + } if (NULL != manifest_files.filename_list) { loader_instance_heap_free(inst, manifest_files.filename_list); } @@ -5349,9 +5625,11 @@ static void loaderAddImplicitLayers(const struct loader_instance *inst, struct l // Get the layer name(s) from the env_name environment variable. If layer is found in // search_list then add it to layer_list. But only add it to layer_list if type_flags matches. -static void loaderAddEnvironmentLayers(struct loader_instance *inst, const enum layer_type_flags type_flags, const char *env_name, - struct loader_layer_list *target_list, struct loader_layer_list *expanded_target_list, - const struct loader_layer_list *source_list) { +static VkResult loaderAddEnvironmentLayers(struct loader_instance *inst, const enum layer_type_flags type_flags, + const char *env_name, struct loader_layer_list *target_list, + struct loader_layer_list *expanded_target_list, + const struct loader_layer_list *source_list) { + VkResult res = VK_SUCCESS; char *next, *name; char *layer_env = loader_getenv(env_name, inst); if (layer_env == NULL) { @@ -5365,7 +5643,10 @@ static void loaderAddEnvironmentLayers(struct loader_instance *inst, const enum while (name && *name) { next = loader_get_next_path(name); - loaderAddLayerNameToList(inst, name, type_flags, source_list, target_list, expanded_target_list); + res = loaderAddLayerNameToList(inst, name, type_flags, source_list, target_list, expanded_target_list); + if (res != VK_SUCCESS) { + goto out; + } name = next; } @@ -5375,7 +5656,7 @@ out: loader_free_getenv(layer_env, inst); } - return; + return res; } VkResult loaderEnableInstanceLayers(struct loader_instance *inst, const VkInstanceCreateInfo *pCreateInfo, @@ -5404,8 +5685,11 @@ VkResult loaderEnableInstanceLayers(struct loader_instance *inst, const VkInstan loaderAddImplicitLayers(inst, &inst->app_activated_layer_list, &inst->expanded_activated_layer_list, instance_layers); // Add any layers specified via environment variable next - loaderAddEnvironmentLayers(inst, VK_LAYER_TYPE_FLAG_EXPLICIT_LAYER, "VK_INSTANCE_LAYERS", &inst->app_activated_layer_list, - &inst->expanded_activated_layer_list, instance_layers); + err = loaderAddEnvironmentLayers(inst, VK_LAYER_TYPE_FLAG_EXPLICIT_LAYER, "VK_INSTANCE_LAYERS", &inst->app_activated_layer_list, + &inst->expanded_activated_layer_list, instance_layers); + if (err != VK_SUCCESS) { + goto out; + } // Add layers specified by the application err = loaderAddLayerNamesToList(inst, &inst->app_activated_layer_list, &inst->expanded_activated_layer_list, @@ -5427,6 +5711,7 @@ VkResult loaderEnableInstanceLayers(struct loader_instance *inst, const VkInstan } } +out: return err; } @@ -5749,28 +6034,46 @@ VkResult loader_create_instance_chain(const VkInstanceCreateInfo *pCreateInfo, c } } + VkLoaderFeatureFlags feature_flags = 0; +#if defined(_WIN32) + IDXGIFactory6* dxgi_factory = NULL; + HRESULT hres = fpCreateDXGIFactory1(&IID_IDXGIFactory6, &dxgi_factory); + if (hres == S_OK) { + feature_flags |= VK_LOADER_FEATURE_PHYSICAL_DEVICE_SORTING; + dxgi_factory->lpVtbl->Release(dxgi_factory); + } +#endif + PFN_vkCreateInstance fpCreateInstance = (PFN_vkCreateInstance)next_gipa(*created_instance, "vkCreateInstance"); if (fpCreateInstance) { - VkLayerInstanceCreateInfo create_info_disp; - - create_info_disp.sType = VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO; - create_info_disp.function = VK_LOADER_DATA_CALLBACK; - - create_info_disp.u.pfnSetInstanceLoaderData = vkSetInstanceDispatch; - - create_info_disp.pNext = loader_create_info.pNext; - loader_create_info.pNext = &create_info_disp; - - VkLayerInstanceCreateInfo create_info_disp2; - - create_info_disp2.sType = VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO; - create_info_disp2.function = VK_LOADER_LAYER_CREATE_DEVICE_CALLBACK; - - create_info_disp2.u.layerDevice.pfnLayerCreateDevice = loader_layer_create_device; - create_info_disp2.u.layerDevice.pfnLayerDestroyDevice = loader_layer_destroy_device; - - create_info_disp2.pNext = loader_create_info.pNext; - loader_create_info.pNext = &create_info_disp2; + const VkLayerInstanceCreateInfo instance_dispatch = { + .sType = VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO, + .pNext = loader_create_info.pNext, + .function = VK_LOADER_DATA_CALLBACK, + .u = { + .pfnSetInstanceLoaderData = vkSetInstanceDispatch, + }, + }; + const VkLayerInstanceCreateInfo device_callback = { + .sType = VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO, + .pNext = &instance_dispatch, + .function = VK_LOADER_LAYER_CREATE_DEVICE_CALLBACK, + .u = { + .layerDevice = { + .pfnLayerCreateDevice = loader_layer_create_device, + .pfnLayerDestroyDevice = loader_layer_destroy_device, + }, + }, + }; + const VkLayerInstanceCreateInfo loader_features = { + .sType = VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO, + .pNext = &device_callback, + .function = VK_LOADER_FEATURES, + .u = { + .loaderFeatures = feature_flags, + }, + }; + loader_create_info.pNext = &loader_features; res = fpCreateInstance(&loader_create_info, pAllocator, created_instance); } else { @@ -6011,8 +6314,11 @@ VkResult loader_validate_instance_extensions(struct loader_instance *inst, const // Build the lists of active layers (including metalayers) and expanded layers (with metalayers resolved to their components) loaderAddImplicitLayers(inst, &active_layers, &expanded_layers, instance_layers); - loaderAddEnvironmentLayers(inst, VK_LAYER_TYPE_FLAG_EXPLICIT_LAYER, ENABLED_LAYERS_ENV, &active_layers, &expanded_layers, - instance_layers); + res = loaderAddEnvironmentLayers(inst, VK_LAYER_TYPE_FLAG_EXPLICIT_LAYER, ENABLED_LAYERS_ENV, &active_layers, &expanded_layers, + instance_layers); + if (res != VK_SUCCESS) { + goto out; + } res = loaderAddLayerNamesToList(inst, &active_layers, &expanded_layers, pCreateInfo->enabledLayerCount, pCreateInfo->ppEnabledLayerNames, instance_layers); if (VK_SUCCESS != res) { @@ -6579,7 +6885,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(VkPhysicalDevice physical if (!dev->extensions.khr_device_group_enabled) { VkPhysicalDeviceProperties properties; icd_term->dispatch.GetPhysicalDeviceProperties(phys_dev_term->phys_dev, &properties); - if (properties.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) { + if (properties.apiVersion >= VK_API_VERSION_1_1) { dev->extensions.khr_device_group_enabled = true; } } @@ -6744,11 +7050,143 @@ out: return res; } +struct LoaderSortedPhysicalDevice { + uint32_t device_count; + VkPhysicalDevice* physical_devices; + uint32_t icd_index; + struct loader_icd_term* icd_term; +}; + +// This function allocates an array in sorted_devices which must be freed by the caller if not null +VkResult ReadSortedPhysicalDevices(struct loader_instance *inst, struct LoaderSortedPhysicalDevice **sorted_devices, uint32_t* sorted_count) +{ + VkResult res = VK_SUCCESS; + +#if defined(_WIN32) + uint32_t sorted_alloc = 0; + struct loader_icd_term *icd_term = NULL; + IDXGIFactory6* dxgi_factory = NULL; + HRESULT hres = fpCreateDXGIFactory1(&IID_IDXGIFactory6, &dxgi_factory); + if (hres != S_OK) { + loader_log(inst, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, "Failed to create DXGI factory 6. Physical devices will not be sorted"); + } + else { + sorted_alloc = 16; + *sorted_devices = loader_instance_heap_alloc(inst, sorted_alloc * sizeof(struct LoaderSortedPhysicalDevice), VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); + if (*sorted_devices == NULL) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + + memset(*sorted_devices, 0, sorted_alloc * sizeof(struct LoaderSortedPhysicalDevice)); + + *sorted_count = 0; + for (uint32_t i = 0; ; ++i) { + IDXGIAdapter1* adapter; + hres = dxgi_factory->lpVtbl->EnumAdapterByGpuPreference(dxgi_factory, i, DXGI_GPU_PREFERENCE_UNSPECIFIED, &IID_IDXGIAdapter1, &adapter); + if (hres == DXGI_ERROR_NOT_FOUND) { + break; // No more adapters + } + else if (hres != S_OK) { + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "Failed to enumerate adapters by GPU preference at index %u. This adapter will not be sorted", i); + break; + } + + DXGI_ADAPTER_DESC1 description; + hres = adapter->lpVtbl->GetDesc1(adapter, &description); + if (hres != S_OK) { + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "Failed to get adapter LUID index %u. This adapter will not be sorted", i); + continue; + } + + if (sorted_alloc <= i) { + uint32_t old_size = sorted_alloc * sizeof(struct LoaderSortedPhysicalDevice); + *sorted_devices = loader_instance_heap_realloc(inst, *sorted_devices, old_size, 2 * old_size, VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); + if (*sorted_devices == NULL) { + adapter->lpVtbl->Release(adapter); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + sorted_alloc *= 2; + } + struct LoaderSortedPhysicalDevice *sorted_array = *sorted_devices; + sorted_array[*sorted_count].device_count = 0; + sorted_array[*sorted_count].physical_devices = NULL; + //*sorted_count = i; + + icd_term = inst->icd_terms; + for (uint32_t icd_idx = 0; NULL != icd_term; icd_term = icd_term->next, icd_idx++) { + // This is the new behavior, which cannot be run unless the ICD provides EnumerateAdapterPhysicalDevices + if (icd_term->scanned_icd->EnumerateAdapterPhysicalDevices == NULL) { + continue; + } + + uint32_t count; + VkResult vkres = icd_term->scanned_icd->EnumerateAdapterPhysicalDevices(icd_term->instance, description.AdapterLuid, &count, NULL); + if (vkres == VK_ERROR_INCOMPATIBLE_DRIVER) { + continue; // This driver doesn't support the adapter + } else if (vkres == VK_ERROR_OUT_OF_HOST_MEMORY) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } else if (vkres != VK_SUCCESS) { + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "Failed to convert DXGI adapter into Vulkan physical device with unexpected error code"); + continue; + } + + // Get the actual physical devices + if (0 != count) + { + do { + sorted_array[*sorted_count].physical_devices = loader_instance_heap_realloc(inst, sorted_array[*sorted_count].physical_devices, sorted_array[*sorted_count].device_count * sizeof(VkPhysicalDevice), count * sizeof(VkPhysicalDevice), VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); + if (sorted_array[*sorted_count].physical_devices == NULL) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + break; + } + sorted_array[*sorted_count].device_count = count; + } while ((vkres = icd_term->scanned_icd->EnumerateAdapterPhysicalDevices(icd_term->instance, description.AdapterLuid, &count, sorted_array[*sorted_count].physical_devices)) == VK_INCOMPLETE); + } + + if (vkres != VK_SUCCESS) { + loader_instance_heap_free(inst, sorted_array[*sorted_count].physical_devices); + sorted_array[*sorted_count].physical_devices = NULL; + if (vkres == VK_ERROR_OUT_OF_HOST_MEMORY) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } else { + loader_log(inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "Failed to convert DXGI adapter into Vulkan physical device"); + continue; + } + } + inst->total_gpu_count += (sorted_array[*sorted_count].device_count = count); + sorted_array[*sorted_count].icd_index = icd_idx; + sorted_array[*sorted_count].icd_term = icd_term; + ++(*sorted_count); + } + + adapter->lpVtbl->Release(adapter); + } + + dxgi_factory->lpVtbl->Release(dxgi_factory); + } + +out: +#endif + + if (*sorted_count == 0 && *sorted_devices != NULL) { + loader_instance_heap_free(inst, *sorted_devices); + *sorted_devices = NULL; + } + return res; +} + VkResult setupLoaderTermPhysDevs(struct loader_instance *inst) { VkResult res = VK_SUCCESS; struct loader_icd_term *icd_term; struct loader_phys_dev_per_icd *icd_phys_dev_array = NULL; struct loader_physical_device_term **new_phys_devs = NULL; + struct LoaderSortedPhysicalDevice *sorted_phys_dev_array = NULL; + uint32_t sorted_count = 0; inst->total_gpu_count = 0; @@ -6765,11 +7203,29 @@ VkResult setupLoaderTermPhysDevs(struct loader_instance *inst) { goto out; } memset(icd_phys_dev_array, 0, sizeof(struct loader_phys_dev_per_icd) * inst->total_icd_count); - icd_term = inst->icd_terms; + + // Get the physical devices supported by platform sorting mechanism into a separate list + res = ReadSortedPhysicalDevices(inst, &sorted_phys_dev_array, &sorted_count); + if (VK_SUCCESS != res) { + goto out; + } // For each ICD, query the number of physical devices, and then get an // internal value for those physical devices. + icd_term = inst->icd_terms; for (uint32_t icd_idx = 0; NULL != icd_term; icd_term = icd_term->next, icd_idx++) { + icd_phys_dev_array[icd_idx].count = 0; + icd_phys_dev_array[icd_idx].phys_devs = NULL; + icd_phys_dev_array[icd_idx].this_icd_term = NULL; + + // This is the legacy behavior which should be skipped if EnumerateAdapterPhysicalDevices is available + // and we successfully enumerated sorted adapters using ReadSortedPhysicalDevices. +#if defined(VK_USE_PLATFORM_WIN32_KHR) + if (sorted_count && icd_term->scanned_icd->EnumerateAdapterPhysicalDevices != NULL) { + continue; + } +#endif + res = icd_term->dispatch.EnumeratePhysicalDevices(icd_term->instance, &icd_phys_dev_array[icd_idx].count, NULL); if (VK_SUCCESS != res) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -6822,6 +7278,48 @@ VkResult setupLoaderTermPhysDevs(struct loader_instance *inst) { // Copy or create everything to fill the new array of physical devices uint32_t idx = 0; + +#if defined(_WIN32) + // Copy over everything found through sorted enumeration + for (uint32_t i = 0; i < sorted_count; ++i) { + for (uint32_t j = 0; j < sorted_phys_dev_array[i].device_count; ++j) { + // Check if this physical device is already in the old buffer + if (NULL != inst->phys_devs_term) { + for (uint32_t old_idx = 0; old_idx < inst->phys_dev_count_term; old_idx++) { + if (sorted_phys_dev_array[i].physical_devices[j] == inst->phys_devs_term[old_idx]->phys_dev) { + new_phys_devs[idx] = inst->phys_devs_term[old_idx]; + break; + } + } + } + + // If this physical device isn't in the old buffer, then we need to create it. + if (NULL == new_phys_devs[idx]) { + new_phys_devs[idx] = loader_instance_heap_alloc(inst, sizeof(struct loader_physical_device_term), + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == new_phys_devs[idx]) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevs: Failed to allocate " + "physical device terminator object %d", + idx); + inst->total_gpu_count = idx; + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + + loader_set_dispatch((void *)new_phys_devs[idx], inst->disp); + new_phys_devs[idx]->this_icd_term = sorted_phys_dev_array[i].icd_term; + new_phys_devs[idx]->icd_index = (uint8_t)(sorted_phys_dev_array[i].icd_index); + new_phys_devs[idx]->phys_dev = sorted_phys_dev_array[i].physical_devices[j]; + } + + // Increment the count of new physical devices + idx++; + } + } +#endif + + // Copy over everything found through EnumeratePhysicalDevices for (uint32_t icd_idx = 0; icd_idx < inst->total_icd_count; icd_idx++) { for (uint32_t pd_idx = 0; pd_idx < icd_phys_dev_array[icd_idx].count; pd_idx++) { // Check if this physical device is already in the old buffer @@ -6893,6 +7391,15 @@ out: inst->phys_devs_term = new_phys_devs; } + if (sorted_phys_dev_array != NULL) { + for (uint32_t i = 0; i < sorted_count; ++i) { + if (sorted_phys_dev_array[i].device_count > 0 && sorted_phys_dev_array[i].physical_devices != NULL) { + loader_instance_heap_free(inst, sorted_phys_dev_array[i].physical_devices); + } + } + loader_instance_heap_free(inst, sorted_phys_dev_array); + } + return res; } @@ -7036,7 +7543,6 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(VkP if (pProperties == NULL) { *pPropertyCount = count; loader_destroy_generic_list(inst, (struct loader_generic_list *)&local_ext_list); - loader_platform_thread_unlock_mutex(&loader_lock); return VK_SUCCESS; } @@ -7048,14 +7554,12 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(VkP loader_destroy_generic_list(inst, (struct loader_generic_list *)&local_ext_list); if (copy_size < count) { - loader_platform_thread_unlock_mutex(&loader_lock); return VK_INCOMPLETE; } } else { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "vkEnumerateDeviceExtensionProperties: pLayerName " "is too long or is badly formed"); - loader_platform_thread_unlock_mutex(&loader_lock); return VK_ERROR_EXTENSION_NOT_PRESENT; } @@ -7065,10 +7569,26 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(VkP // This case is during the call down the instance chain with pLayerName == NULL struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; uint32_t icd_ext_count = *pPropertyCount; + VkExtensionProperties *icd_props_list = pProperties; VkResult res; - // Get the available device extensions - res = icd_term->dispatch.EnumerateDeviceExtensionProperties(phys_dev_term->phys_dev, NULL, &icd_ext_count, pProperties); + if (NULL == icd_props_list) { + // We need to find the count without duplicates. This requires querying the driver for the names of the extensions. + // A small amount of storage is then needed to facilitate the de-duplication. + res = icd_term->dispatch.EnumerateDeviceExtensionProperties(phys_dev_term->phys_dev, NULL, &icd_ext_count, NULL); + if (res != VK_SUCCESS) { + goto out; + } + icd_props_list = loader_instance_heap_alloc(icd_term->this_instance, sizeof(VkExtensionProperties) * icd_ext_count, + VK_SYSTEM_ALLOCATION_SCOPE_COMMAND); + if (NULL == icd_props_list) { + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + } + + // Get the available device extension count, and if pProperties is not NULL, the extensions as well + res = icd_term->dispatch.EnumerateDeviceExtensionProperties(phys_dev_term->phys_dev, NULL, &icd_ext_count, icd_props_list); if (res != VK_SUCCESS) { goto out; } @@ -7079,36 +7599,36 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(VkP } loaderAddImplicitLayers(icd_term->this_instance, &implicit_layer_list, NULL, &icd_term->this_instance->instance_layer_list); + + // Initialize dev_extension list within the physicalDevice object + res = loader_init_device_extensions(icd_term->this_instance, phys_dev_term, icd_ext_count, icd_props_list, &icd_exts); + if (res != VK_SUCCESS) { + goto out; + } + // We need to determine which implicit layers are active, and then add their extensions. This can't be cached as // it depends on results of environment variables (which can change). - if (pProperties != NULL) { - // Initialize dev_extension list within the physicalDevice object - res = loader_init_device_extensions(icd_term->this_instance, phys_dev_term, icd_ext_count, pProperties, &icd_exts); - if (res != VK_SUCCESS) { - goto out; - } - - // We need to determine which implicit layers are active, and then add their extensions. This can't be cached as - // it depends on results of environment variables (which can change). - res = loader_add_to_ext_list(icd_term->this_instance, &all_exts, icd_exts.count, icd_exts.list); - if (res != VK_SUCCESS) { - goto out; - } + res = loader_add_to_ext_list(icd_term->this_instance, &all_exts, icd_exts.count, icd_exts.list); + if (res != VK_SUCCESS) { + goto out; + } - loaderAddImplicitLayers(icd_term->this_instance, &implicit_layer_list, NULL, &icd_term->this_instance->instance_layer_list); + loaderAddImplicitLayers(icd_term->this_instance, &implicit_layer_list, NULL, &icd_term->this_instance->instance_layer_list); - for (uint32_t i = 0; i < implicit_layer_list.count; i++) { - for (uint32_t j = 0; j < implicit_layer_list.list[i].device_extension_list.count; j++) { - res = loader_add_to_ext_list(icd_term->this_instance, &all_exts, 1, - &implicit_layer_list.list[i].device_extension_list.list[j].props); - if (res != VK_SUCCESS) { - goto out; - } + for (uint32_t i = 0; i < implicit_layer_list.count; i++) { + for (uint32_t j = 0; j < implicit_layer_list.list[i].device_extension_list.count; j++) { + res = loader_add_to_ext_list(icd_term->this_instance, &all_exts, 1, + &implicit_layer_list.list[i].device_extension_list.list[j].props); + if (res != VK_SUCCESS) { + goto out; } } - uint32_t capacity = *pPropertyCount; - VkExtensionProperties *props = pProperties; + } + uint32_t capacity = *pPropertyCount; + VkExtensionProperties *props = pProperties; + res = VK_SUCCESS; + if (NULL != pProperties) { for (uint32_t i = 0; i < all_exts.count && i < capacity; i++) { props[i] = all_exts.list[i]; } @@ -7120,14 +7640,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateDeviceExtensionProperties(VkP *pPropertyCount = all_exts.count; } } else { - // Just return the count; need to add in the count of implicit layer extensions - // don't worry about duplicates being added in the count - *pPropertyCount = icd_ext_count; - - for (uint32_t i = 0; i < implicit_layer_list.count; i++) { - *pPropertyCount += implicit_layer_list.list[i].device_extension_list.count; - } - res = VK_SUCCESS; + *pPropertyCount = all_exts.count; } out: @@ -7141,7 +7654,9 @@ out: if (NULL != icd_exts.list) { loader_destroy_generic_list(icd_term->this_instance, (struct loader_generic_list *)&icd_exts); } - + if (NULL == pProperties && NULL != icd_props_list) { + loader_instance_heap_free(icd_term->this_instance, icd_props_list); + } return res; } @@ -7201,7 +7716,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumerateInstanceVersion(const VkEnumerateInstanceVersionChain *chain, uint32_t* pApiVersion) { // NOTE: The Vulkan WG doesn't want us checking pApiVersion for NULL, but instead // prefers us crashing. - *pApiVersion = VK_MAKE_VERSION(loader_major_version, loader_minor_version, VK_HEADER_VERSION); + *pApiVersion = VK_HEADER_VERSION_COMPLETE; return VK_SUCCESS; } @@ -7238,10 +7753,14 @@ terminator_EnumerateInstanceExtensionProperties(const VkEnumerateInstanceExtensi } } } else { + // Preload ICD libraries so subsequent calls to EnumerateInstanceExtensionProperties don't have to load them + loader_preload_icds(); + // Scan/discover all ICD libraries memset(&icd_tramp_list, 0, sizeof(icd_tramp_list)); res = loader_icd_scan(NULL, &icd_tramp_list); - if (VK_SUCCESS != res) { + // EnumerateInstanceExtensionProperties can't return anything other than OOM or VK_ERROR_LAYER_NOT_PRESENT + if ((VK_SUCCESS != res && icd_tramp_list.count > 0) || res == VK_ERROR_OUT_OF_HOST_MEMORY) { goto out; } // Get extensions from all ICD's, merge so no duplicates @@ -7330,7 +7849,7 @@ out: return result; } -#if defined(_WIN32) && defined(LOADER_DYNAMIC_LIB) +#if defined(_WIN32) BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) { switch (reason) { case DLL_PROCESS_ATTACH: @@ -7362,7 +7881,10 @@ VkResult setupLoaderTermPhysDevGroups(struct loader_instance *inst) { uint32_t cur_icd_group_count = 0; VkPhysicalDeviceGroupPropertiesKHR **new_phys_dev_groups = NULL; VkPhysicalDeviceGroupPropertiesKHR *local_phys_dev_groups = NULL; + bool *local_phys_dev_group_sorted = NULL; PFN_vkEnumeratePhysicalDeviceGroups fpEnumeratePhysicalDeviceGroups = NULL; + struct LoaderSortedPhysicalDevice* sorted_phys_dev_array = NULL; + uint32_t sorted_count = 0; if (0 == inst->phys_dev_count_term) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, @@ -7426,7 +7948,8 @@ VkResult setupLoaderTermPhysDevGroups(struct loader_instance *inst) { // Create a temporary array (on the stack) to keep track of the // returned VkPhysicalDevice values. local_phys_dev_groups = loader_stack_alloc(sizeof(VkPhysicalDeviceGroupProperties) * total_count); - if (NULL == local_phys_dev_groups) { + local_phys_dev_group_sorted = loader_stack_alloc(sizeof(bool) * total_count); + if (NULL == local_phys_dev_groups || NULL == local_phys_dev_group_sorted) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "setupLoaderTermPhysDevGroups: Failed to allocate local " "physical device group array of size %d", @@ -7436,17 +7959,31 @@ VkResult setupLoaderTermPhysDevGroups(struct loader_instance *inst) { } // Initialize the memory to something valid memset(local_phys_dev_groups, 0, sizeof(VkPhysicalDeviceGroupProperties) * total_count); + memset(local_phys_dev_group_sorted, 0, sizeof(bool) * total_count); for (uint32_t group = 0; group < total_count; group++) { local_phys_dev_groups[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR; local_phys_dev_groups[group].pNext = NULL; local_phys_dev_groups[group].subsetAllocation = false; } + // Get the physical devices supported by platform sorting mechanism into a separate list + res = ReadSortedPhysicalDevices(inst, &sorted_phys_dev_array, &sorted_count); + if (VK_SUCCESS != res) { + goto out; + } + cur_icd_group_count = 0; icd_term = inst->icd_terms; for (uint32_t icd_idx = 0; NULL != icd_term; icd_term = icd_term->next, icd_idx++) { uint32_t count_this_time = total_count - cur_icd_group_count; + // Check if this group can be sorted +#if defined(VK_USE_PLATFORM_WIN32_KHR) + bool icd_sorted = sorted_count && (icd_term->scanned_icd->EnumerateAdapterPhysicalDevices != NULL); +#else + bool icd_sorted = false; +#endif + // Get the function pointer to use to call into the ICD. This could be the core or KHR version if (inst->enabled_known_extensions.khr_device_group_creation) { fpEnumeratePhysicalDeviceGroups = icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHR; @@ -7478,10 +8015,14 @@ VkResult setupLoaderTermPhysDevGroups(struct loader_instance *inst) { for (uint32_t indiv_gpu = 0; indiv_gpu < count_this_time; indiv_gpu++) { local_phys_dev_groups[indiv_gpu + cur_icd_group_count].physicalDeviceCount = 1; local_phys_dev_groups[indiv_gpu + cur_icd_group_count].physicalDevices[0] = phys_dev_array[indiv_gpu]; + local_phys_dev_group_sorted[indiv_gpu + cur_icd_group_count] = icd_sorted; } } else { res = fpEnumeratePhysicalDeviceGroups(icd_term->instance, &count_this_time, &local_phys_dev_groups[cur_icd_group_count]); + for (uint32_t group = 0; group < count_this_time; ++group) { + local_phys_dev_group_sorted[group + cur_icd_group_count] = icd_sorted; + } if (VK_SUCCESS != res) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "setupLoaderTermPhysDevGroups: Failed during dispatch call of " @@ -7516,8 +8057,87 @@ VkResult setupLoaderTermPhysDevGroups(struct loader_instance *inst) { } } + uint32_t idx = 0; + +#if defined(_WIN32) + // Copy over everything found through sorted enumeration + for (uint32_t i = 0; i < sorted_count; ++i) { + + // Find the VkPhysicalDeviceGroupProperties object in local_phys_dev_groups + VkPhysicalDeviceGroupProperties *group_properties = NULL; + for (uint32_t group = 0; group < total_count; group++) { + if (sorted_phys_dev_array[i].device_count != local_phys_dev_groups[group].physicalDeviceCount) { + continue; + } + + bool match = true; + for (uint32_t group_gpu = 0; group_gpu < local_phys_dev_groups[group].physicalDeviceCount; group_gpu++) { + if (sorted_phys_dev_array[i].physical_devices[group_gpu] != ((struct loader_physical_device_term*) local_phys_dev_groups[group].physicalDevices[group_gpu])->phys_dev) { + match = false; + break; + } + } + + if (match) { + group_properties = &local_phys_dev_groups[group]; + } + } + + // Check if this physical device group with the same contents is already in the old buffer + for (uint32_t old_idx = 0; old_idx < inst->phys_dev_group_count_term; old_idx++) { + if (NULL != group_properties && group_properties->physicalDeviceCount == inst->phys_dev_groups_term[old_idx]->physicalDeviceCount) { + bool found_all_gpus = true; + for (uint32_t old_gpu = 0; old_gpu < inst->phys_dev_groups_term[old_idx]->physicalDeviceCount; old_gpu++) { + bool found_gpu = false; + for (uint32_t new_gpu = 0; new_gpu < group_properties->physicalDeviceCount; new_gpu++) { + if (group_properties->physicalDevices[new_gpu] == inst->phys_dev_groups_term[old_idx]->physicalDevices[old_gpu]) { + found_gpu = true; + break; + } + } + + if (!found_gpu) { + found_all_gpus = false; + break; + } + } + if (!found_all_gpus) { + continue; + } + else { + new_phys_dev_groups[idx] = inst->phys_dev_groups_term[old_idx]; + break; + } + } + } + + // If this physical device group isn't in the old buffer, create it + if (group_properties != NULL && NULL == new_phys_dev_groups[idx]) { + new_phys_dev_groups[idx] = (VkPhysicalDeviceGroupPropertiesKHR*)loader_instance_heap_alloc( + inst, sizeof(VkPhysicalDeviceGroupPropertiesKHR), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); + if (NULL == new_phys_dev_groups[idx]) { + loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "setupLoaderTermPhysDevGroups: Failed to allocate " + "physical device group Terminator object %d", + idx); + total_count = idx; + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + memcpy(new_phys_dev_groups[idx], group_properties, sizeof(VkPhysicalDeviceGroupPropertiesKHR)); + } + + ++idx; + } +#endif + // Copy or create everything to fill the new array of physical device groups for (uint32_t new_idx = 0; new_idx < total_count; new_idx++) { + // Skip groups which have been included through sorting + if (local_phys_dev_group_sorted[new_idx] || local_phys_dev_groups[new_idx].physicalDeviceCount == 0) { + continue; + } + // Check if this physical device group with the same contents is already in the old buffer for (uint32_t old_idx = 0; old_idx < inst->phys_dev_group_count_term; old_idx++) { if (local_phys_dev_groups[new_idx].physicalDeviceCount == inst->phys_dev_groups_term[old_idx]->physicalDeviceCount) { @@ -7539,28 +8159,30 @@ VkResult setupLoaderTermPhysDevGroups(struct loader_instance *inst) { if (!found_all_gpus) { continue; } else { - new_phys_dev_groups[new_idx] = inst->phys_dev_groups_term[old_idx]; + new_phys_dev_groups[idx] = inst->phys_dev_groups_term[old_idx]; break; } } } // If this physical device group isn't in the old buffer, create it - if (NULL == new_phys_dev_groups[new_idx]) { - new_phys_dev_groups[new_idx] = (VkPhysicalDeviceGroupPropertiesKHR *)loader_instance_heap_alloc( + if (NULL == new_phys_dev_groups[idx]) { + new_phys_dev_groups[idx] = (VkPhysicalDeviceGroupPropertiesKHR *)loader_instance_heap_alloc( inst, sizeof(VkPhysicalDeviceGroupPropertiesKHR), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE); - if (NULL == new_phys_dev_groups[new_idx]) { + if (NULL == new_phys_dev_groups[idx]) { loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, "setupLoaderTermPhysDevGroups: Failed to allocate " "physical device group Terminator object %d", - new_idx); - total_count = new_idx; + idx); + total_count = idx; res = VK_ERROR_OUT_OF_HOST_MEMORY; goto out; } - memcpy(new_phys_dev_groups[new_idx], &local_phys_dev_groups[new_idx], + memcpy(new_phys_dev_groups[idx], &local_phys_dev_groups[new_idx], sizeof(VkPhysicalDeviceGroupPropertiesKHR)); } + + ++idx; } out: @@ -7597,6 +8219,15 @@ out: inst->phys_dev_groups_term = new_phys_dev_groups; } + if (sorted_phys_dev_array != NULL) { + for (uint32_t i = 0; i < sorted_count; ++i) { + if (sorted_phys_dev_array[i].device_count > 0 && sorted_phys_dev_array[i].physical_devices != NULL) { + loader_instance_heap_free(inst, sorted_phys_dev_array[i].physical_devices); + } + } + loader_instance_heap_free(inst, sorted_phys_dev_array); + } + return res; } diff --git a/thirdparty/vulkan/loader/loader.h b/thirdparty/vulkan/loader/loader.h index 56745a968d..621eb0be3b 100644 --- a/thirdparty/vulkan/loader/loader.h +++ b/thirdparty/vulkan/loader/loader.h @@ -156,6 +156,8 @@ struct loader_layer_properties { bool keep; uint32_t num_blacklist_layers; char (*blacklist_layer_names)[MAX_STRING_SIZE]; + uint32_t num_app_key_paths; + char (*app_key_paths)[MAX_STRING_SIZE]; }; struct loader_layer_list { @@ -324,6 +326,9 @@ struct loader_instance { #ifdef VK_USE_PLATFORM_XLIB_KHR bool wsi_xlib_surface_enabled; #endif +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + bool wsi_directfb_surface_enabled; +#endif #ifdef VK_USE_PLATFORM_ANDROID_KHR bool wsi_android_surface_enabled; #endif @@ -382,6 +387,9 @@ struct loader_scanned_icd { PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr; PFN_vkCreateInstance CreateInstance; PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties; +#if defined(VK_USE_PLATFORM_WIN32_KHR) + PFN_vk_icdEnumerateAdapterPhysicalDevices EnumerateAdapterPhysicalDevices; +#endif }; static inline struct loader_instance *loader_instance(VkInstance instance) { return (struct loader_instance *)instance; } @@ -420,11 +428,9 @@ static inline void loader_init_dispatch(void *obj, const void *data) { // Global variables used across files extern struct loader_struct loader; extern THREAD_LOCAL_DECL struct loader_instance *tls_instance; -#if defined(_WIN32) && !defined(LOADER_DYNAMIC_LIB) -extern LOADER_PLATFORM_THREAD_ONCE_DEFINITION(once_init); -#endif extern loader_platform_thread_mutex loader_lock; extern loader_platform_thread_mutex loader_json_lock; +extern loader_platform_thread_mutex loader_preload_icd_lock; struct loader_msg_callback_map_entry { VkDebugReportCallbackEXT icd_obj; @@ -455,6 +461,8 @@ VkResult loader_validate_instance_extensions(struct loader_instance *inst, const const VkInstanceCreateInfo *pCreateInfo); void loader_initialize(void); +void loader_preload_icds(void); +void loader_unload_preloaded_icds(void); 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); @@ -471,9 +479,9 @@ VkResult loader_init_generic_list(const struct loader_instance *inst, struct loa void loader_destroy_generic_list(const struct loader_instance *inst, struct loader_generic_list *list); void loaderDestroyLayerList(const struct loader_instance *inst, struct loader_device *device, struct loader_layer_list *layer_list); void loaderDeleteLayerListAndProperties(const struct loader_instance *inst, struct loader_layer_list *layer_list); -void loaderAddLayerNameToList(const struct loader_instance *inst, const char *name, const enum layer_type_flags type_flags, - const struct loader_layer_list *source_list, struct loader_layer_list *target_list, - struct loader_layer_list *expanded_target_list); +VkResult loaderAddLayerNameToList(const struct loader_instance *inst, const char *name, const enum layer_type_flags type_flags, + const struct loader_layer_list *source_list, struct loader_layer_list *target_list, + struct loader_layer_list *expanded_target_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 loaderScanForLayers(struct loader_instance *inst, struct loader_layer_list *instance_layers); diff --git a/thirdparty/vulkan/loader/trampoline.c b/thirdparty/vulkan/loader/trampoline.c index a6a37f0fce..e0530802a2 100644 --- a/thirdparty/vulkan/loader/trampoline.c +++ b/thirdparty/vulkan/loader/trampoline.c @@ -127,7 +127,7 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionPropert } size_t lib_count = 0; - // Prepend layers onto the chain if they implment this entry point + // Prepend layers onto the chain if they implement this entry point for (uint32_t i = 0; i < layers.count; ++i) { if (!loaderImplicitLayerIsEnabled(NULL, layers.list + i) || layers.list[i].pre_instance_functions.enumerate_instance_extension_properties[0] == '\0') { @@ -221,7 +221,7 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties( } size_t lib_count = 0; - // Prepend layers onto the chain if they implment this entry point + // Prepend layers onto the chain if they implement this entry point for (uint32_t i = 0; i < layers.count; ++i) { if (!loaderImplicitLayerIsEnabled(NULL, layers.list + i) || layers.list[i].pre_instance_functions.enumerate_instance_layer_properties[0] == '\0') { @@ -315,7 +315,7 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceVersion(uint32_t } size_t lib_count = 0; - // Prepend layers onto the chain if they implment this entry point + // Prepend layers onto the chain if they implement this entry point for (uint32_t i = 0; i < layers.count; ++i) { if (!loaderImplicitLayerIsEnabled(NULL, layers.list + i) || layers.list[i].pre_instance_functions.enumerate_instance_version[0] == '\0') { @@ -538,7 +538,7 @@ out: if (NULL != ptr_instance) { if (res != VK_SUCCESS) { - if (NULL != ptr_instance->next) { + if (loader.instances == ptr_instance) { loader.instances = ptr_instance->next; } if (NULL != ptr_instance->disp) { @@ -656,9 +656,14 @@ LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(VkInstance instance, ptr_instance->tmp_report_callbacks); util_FreeDebugReportCreateInfos(pAllocator, ptr_instance->tmp_report_create_infos, ptr_instance->tmp_report_callbacks); } + loader_instance_heap_free(ptr_instance, ptr_instance->disp); loader_instance_heap_free(ptr_instance, ptr_instance); loader_platform_thread_unlock_mutex(&loader_lock); + + // Unload preloaded layers, so if vkEnumerateInstanceExtensionProperties or vkCreateInstance is called again, the ICD's are up + // to date + loader_unload_preloaded_icds(); } LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, @@ -859,7 +864,9 @@ LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue(VkDevice device, uint3 disp = loader_get_dispatch(device); disp->GetDeviceQueue(device, queueNodeIndex, queueIndex, pQueue); - loader_set_dispatch(*pQueue, disp); + if (pQueue != NULL) { + loader_set_dispatch(*pQueue, disp); + } } LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, @@ -2445,8 +2452,7 @@ LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkTrimCommandPool( LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue) { const VkLayerDispatchTable *disp = loader_get_dispatch(device); disp->GetDeviceQueue2(device, pQueueInfo, pQueue); - if (*pQueue != VK_NULL_HANDLE) - { + if (pQueue != NULL && *pQueue != NULL) { loader_set_dispatch(*pQueue, disp); } } diff --git a/thirdparty/vulkan/loader/vk_dispatch_table_helper.h b/thirdparty/vulkan/loader/vk_dispatch_table_helper.h index 386745a1e7..e6026aa698 100644 --- a/thirdparty/vulkan/loader/vk_dispatch_table_helper.h +++ b/thirdparty/vulkan/loader/vk_dispatch_table_helper.h @@ -91,12 +91,33 @@ static VKAPI_ATTR void VKAPI_CALL StubCmdDrawIndexedIndirectCountKHR(VkCommandBu static VKAPI_ATTR VkResult VKAPI_CALL StubGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t* pValue) { return VK_SUCCESS; }; static VKAPI_ATTR VkResult VKAPI_CALL StubWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout) { return VK_SUCCESS; }; static VKAPI_ATTR VkResult VKAPI_CALL StubSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) { return VK_SUCCESS; }; -static VKAPI_ATTR void VKAPI_CALL StubGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { }; -static VKAPI_ATTR void VKAPI_CALL StubGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { }; -static VKAPI_ATTR void VKAPI_CALL StubGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) { }; +static VKAPI_ATTR VkDeviceAddress VKAPI_CALL StubGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { return 0L; }; +static VKAPI_ATTR uint64_t VKAPI_CALL StubGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { return 0L; }; +static VKAPI_ATTR uint64_t VKAPI_CALL StubGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) { return 0L; }; +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR VkResult VKAPI_CALL StubCreateDeferredOperationKHR(VkDevice device, const VkAllocationCallbacks* pAllocator, VkDeferredOperationKHR* pDeferredOperation) { return VK_SUCCESS; }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR void VKAPI_CALL StubDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation, const VkAllocationCallbacks* pAllocator) { }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR uint32_t VKAPI_CALL StubGetDeferredOperationMaxConcurrencyKHR(VkDevice device, VkDeferredOperationKHR operation) { return 0; }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR VkResult VKAPI_CALL StubGetDeferredOperationResultKHR(VkDevice device, VkDeferredOperationKHR operation) { return VK_SUCCESS; }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR VkResult VKAPI_CALL StubDeferredOperationJoinKHR(VkDevice device, VkDeferredOperationKHR operation) { return VK_SUCCESS; }; +#endif // VK_ENABLE_BETA_EXTENSIONS static VKAPI_ATTR VkResult VKAPI_CALL StubGetPipelineExecutablePropertiesKHR(VkDevice device, const VkPipelineInfoKHR* pPipelineInfo, uint32_t* pExecutableCount, VkPipelineExecutablePropertiesKHR* pProperties) { return VK_SUCCESS; }; static VKAPI_ATTR VkResult VKAPI_CALL StubGetPipelineExecutableStatisticsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pStatisticCount, VkPipelineExecutableStatisticKHR* pStatistics) { return VK_SUCCESS; }; static VKAPI_ATTR VkResult VKAPI_CALL StubGetPipelineExecutableInternalRepresentationsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations) { return VK_SUCCESS; }; +static VKAPI_ATTR void VKAPI_CALL StubCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2KHR* pCopyBufferInfo) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2KHR* pCopyImageInfo) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2KHR* pBlitImageInfo) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdResolveImage2KHR(VkCommandBuffer commandBuffer, const VkResolveImageInfo2KHR* pResolveImageInfo) { }; static VKAPI_ATTR VkResult VKAPI_CALL StubDebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo) { return VK_SUCCESS; }; static VKAPI_ATTR VkResult VKAPI_CALL StubDebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo) { return VK_SUCCESS; }; static VKAPI_ATTR void VKAPI_CALL StubCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) { }; @@ -108,7 +129,8 @@ static VKAPI_ATTR void VKAPI_CALL StubCmdEndTransformFeedbackEXT(VkCommandBuffer static VKAPI_ATTR void VKAPI_CALL StubCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index) { }; static VKAPI_ATTR void VKAPI_CALL StubCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index) { }; static VKAPI_ATTR void VKAPI_CALL StubCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride) { }; -static VKAPI_ATTR void VKAPI_CALL StubGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX* pInfo) { }; +static VKAPI_ATTR uint32_t VKAPI_CALL StubGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX* pInfo) { return 0; }; +static VKAPI_ATTR VkResult VKAPI_CALL StubGetImageViewAddressNVX(VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX* pProperties) { return VK_SUCCESS; }; static VKAPI_ATTR void VKAPI_CALL StubCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) { }; static VKAPI_ATTR void VKAPI_CALL StubCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) { }; static VKAPI_ATTR VkResult VKAPI_CALL StubGetShaderInfoAMD(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo) { return VK_SUCCESS; }; @@ -117,14 +139,6 @@ static VKAPI_ATTR VkResult VKAPI_CALL StubGetMemoryWin32HandleNV(VkDevice device #endif // VK_USE_PLATFORM_WIN32_KHR static VKAPI_ATTR void VKAPI_CALL StubCmdBeginConditionalRenderingEXT(VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) { }; static VKAPI_ATTR void VKAPI_CALL StubCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer) { }; -static VKAPI_ATTR void VKAPI_CALL StubCmdProcessCommandsNVX(VkCommandBuffer commandBuffer, const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) { }; -static VKAPI_ATTR void VKAPI_CALL StubCmdReserveSpaceForCommandsNVX(VkCommandBuffer commandBuffer, const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) { }; -static VKAPI_ATTR VkResult VKAPI_CALL StubCreateIndirectCommandsLayoutNVX(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) { return VK_SUCCESS; }; -static VKAPI_ATTR void VKAPI_CALL StubDestroyIndirectCommandsLayoutNVX(VkDevice device, VkIndirectCommandsLayoutNVX indirectCommandsLayout, const VkAllocationCallbacks* pAllocator) { }; -static VKAPI_ATTR VkResult VKAPI_CALL StubCreateObjectTableNVX(VkDevice device, const VkObjectTableCreateInfoNVX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkObjectTableNVX* pObjectTable) { return VK_SUCCESS; }; -static VKAPI_ATTR void VKAPI_CALL StubDestroyObjectTableNVX(VkDevice device, VkObjectTableNVX objectTable, const VkAllocationCallbacks* pAllocator) { }; -static VKAPI_ATTR VkResult VKAPI_CALL StubRegisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectTableEntryNVX* const* ppObjectTableEntries, const uint32_t* pObjectIndices) { return VK_SUCCESS; }; -static VKAPI_ATTR VkResult VKAPI_CALL StubUnregisterObjectsNVX(VkDevice device, VkObjectTableNVX objectTable, uint32_t objectCount, const VkObjectEntryTypeNVX* pObjectEntryTypes, const uint32_t* pObjectIndices) { return VK_SUCCESS; }; static VKAPI_ATTR void VKAPI_CALL StubCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings) { }; static VKAPI_ATTR VkResult VKAPI_CALL StubDisplayPowerControlEXT(VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT* pDisplayPowerInfo) { return VK_SUCCESS; }; static VKAPI_ATTR VkResult VKAPI_CALL StubRegisterDeviceEventEXT(VkDevice device, const VkDeviceEventInfoEXT* pDeviceEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence) { return VK_SUCCESS; }; @@ -150,16 +164,20 @@ static VKAPI_ATTR void VKAPI_CALL StubCmdBindShadingRateImageNV(VkCommandBuffer static VKAPI_ATTR void VKAPI_CALL StubCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV* pShadingRatePalettes) { }; static VKAPI_ATTR void VKAPI_CALL StubCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV* pCustomSampleOrders) { }; static VKAPI_ATTR VkResult VKAPI_CALL StubCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureNV* pAccelerationStructure) { return VK_SUCCESS; }; -static VKAPI_ATTR void VKAPI_CALL StubDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, const VkAllocationCallbacks* pAllocator) { }; +static VKAPI_ATTR void VKAPI_CALL StubDestroyAccelerationStructureKHR(VkDevice device, VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks* pAllocator) { }; +static VKAPI_ATTR void VKAPI_CALL StubDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks* pAllocator) { }; static VKAPI_ATTR void VKAPI_CALL StubGetAccelerationStructureMemoryRequirementsNV(VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements) { }; -static VKAPI_ATTR VkResult VKAPI_CALL StubBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV* pBindInfos) { return VK_SUCCESS; }; -static VKAPI_ATTR void VKAPI_CALL StubCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset) { }; -static VKAPI_ATTR void VKAPI_CALL StubCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkCopyAccelerationStructureModeNV mode) { }; +static VKAPI_ATTR VkResult VKAPI_CALL StubBindAccelerationStructureMemoryKHR(VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoKHR* pBindInfos) { return VK_SUCCESS; }; +static VKAPI_ATTR VkResult VKAPI_CALL StubBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoKHR* pBindInfos) { return VK_SUCCESS; }; +static VKAPI_ATTR void VKAPI_CALL StubCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureKHR dst, VkAccelerationStructureKHR src, VkBuffer scratch, VkDeviceSize scratchOffset) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureKHR dst, VkAccelerationStructureKHR src, VkCopyAccelerationStructureModeKHR mode) { }; static VKAPI_ATTR void VKAPI_CALL StubCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, uint32_t width, uint32_t height, uint32_t depth) { }; static VKAPI_ATTR VkResult VKAPI_CALL StubCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) { return VK_SUCCESS; }; +static VKAPI_ATTR VkResult VKAPI_CALL StubGetRayTracingShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData) { return VK_SUCCESS; }; static VKAPI_ATTR VkResult VKAPI_CALL StubGetRayTracingShaderGroupHandlesNV(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData) { return VK_SUCCESS; }; -static VKAPI_ATTR VkResult VKAPI_CALL StubGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void* pData) { return VK_SUCCESS; }; -static VKAPI_ATTR void VKAPI_CALL StubCmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) { }; +static VKAPI_ATTR VkResult VKAPI_CALL StubGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureKHR accelerationStructure, size_t dataSize, void* pData) { return VK_SUCCESS; }; +static VKAPI_ATTR void VKAPI_CALL StubCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) { }; static VKAPI_ATTR VkResult VKAPI_CALL StubCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader) { return VK_SUCCESS; }; static VKAPI_ATTR VkResult VKAPI_CALL StubGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) { return VK_SUCCESS; }; static VKAPI_ATTR void VKAPI_CALL StubCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker) { }; @@ -180,7 +198,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL StubReleasePerformanceConfigurationINTEL(V static VKAPI_ATTR VkResult VKAPI_CALL StubQueueSetPerformanceConfigurationINTEL(VkQueue queue, VkPerformanceConfigurationINTEL configuration) { return VK_SUCCESS; }; static VKAPI_ATTR VkResult VKAPI_CALL StubGetPerformanceParameterINTEL(VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL* pValue) { return VK_SUCCESS; }; static VKAPI_ATTR void VKAPI_CALL StubSetLocalDimmingAMD(VkDevice device, VkSwapchainKHR swapChain, VkBool32 localDimmingEnable) { }; -static VKAPI_ATTR void VKAPI_CALL StubGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { }; +static VKAPI_ATTR VkDeviceAddress VKAPI_CALL StubGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) { return 0L; }; #ifdef VK_USE_PLATFORM_WIN32_KHR static VKAPI_ATTR VkResult VKAPI_CALL StubAcquireFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain) { return VK_SUCCESS; }; #endif // VK_USE_PLATFORM_WIN32_KHR @@ -192,6 +210,82 @@ static VKAPI_ATTR VkResult VKAPI_CALL StubGetDeviceGroupSurfacePresentModes2EXT( #endif // VK_USE_PLATFORM_WIN32_KHR static VKAPI_ATTR void VKAPI_CALL StubCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) { }; static VKAPI_ATTR void VKAPI_CALL StubResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport* pViewports) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdSetStencilOpEXT(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp) { }; +static VKAPI_ATTR void VKAPI_CALL StubGetGeneratedCommandsMemoryRequirementsNV(VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2* pMemoryRequirements) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdPreprocessGeneratedCommandsNV(VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdExecuteGeneratedCommandsNV(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) { }; +static VKAPI_ATTR void VKAPI_CALL StubCmdBindPipelineShaderGroupNV(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline, uint32_t groupIndex) { }; +static VKAPI_ATTR VkResult VKAPI_CALL StubCreateIndirectCommandsLayoutNV(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNV* pIndirectCommandsLayout) { return VK_SUCCESS; }; +static VKAPI_ATTR void VKAPI_CALL StubDestroyIndirectCommandsLayoutNV(VkDevice device, VkIndirectCommandsLayoutNV indirectCommandsLayout, const VkAllocationCallbacks* pAllocator) { }; +static VKAPI_ATTR VkResult VKAPI_CALL StubCreatePrivateDataSlotEXT(VkDevice device, const VkPrivateDataSlotCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPrivateDataSlotEXT* pPrivateDataSlot) { return VK_SUCCESS; }; +static VKAPI_ATTR void VKAPI_CALL StubDestroyPrivateDataSlotEXT(VkDevice device, VkPrivateDataSlotEXT privateDataSlot, const VkAllocationCallbacks* pAllocator) { }; +static VKAPI_ATTR VkResult VKAPI_CALL StubSetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t data) { return VK_SUCCESS; }; +static VKAPI_ATTR void VKAPI_CALL StubGetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t* pData) { }; +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR VkResult VKAPI_CALL StubCreateAccelerationStructureKHR(VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureKHR* pAccelerationStructure) { return VK_SUCCESS; }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR void VKAPI_CALL StubGetAccelerationStructureMemoryRequirementsKHR(VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoKHR* pInfo, VkMemoryRequirements2* pMemoryRequirements) { }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR void VKAPI_CALL StubCmdBuildAccelerationStructureKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildOffsetInfoKHR* const* ppOffsetInfos) { }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR void VKAPI_CALL StubCmdBuildAccelerationStructureIndirectKHR(VkCommandBuffer commandBuffer, const VkAccelerationStructureBuildGeometryInfoKHR* pInfo, VkBuffer indirectBuffer, VkDeviceSize indirectOffset, uint32_t indirectStride) { }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR VkResult VKAPI_CALL StubBuildAccelerationStructureKHR(VkDevice device, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildOffsetInfoKHR* const* ppOffsetInfos) { return VK_SUCCESS; }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR VkResult VKAPI_CALL StubCopyAccelerationStructureKHR(VkDevice device, const VkCopyAccelerationStructureInfoKHR* pInfo) { return VK_SUCCESS; }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR VkResult VKAPI_CALL StubCopyAccelerationStructureToMemoryKHR(VkDevice device, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) { return VK_SUCCESS; }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR VkResult VKAPI_CALL StubCopyMemoryToAccelerationStructureKHR(VkDevice device, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) { return VK_SUCCESS; }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR VkResult VKAPI_CALL StubWriteAccelerationStructuresPropertiesKHR(VkDevice device, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, size_t dataSize, void* pData, size_t stride) { return VK_SUCCESS; }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR void VKAPI_CALL StubCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR* pInfo) { }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR void VKAPI_CALL StubCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) { }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR void VKAPI_CALL StubCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) { }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR void VKAPI_CALL StubCmdTraceRaysKHR(VkCommandBuffer commandBuffer, const VkStridedBufferRegionKHR* pRaygenShaderBindingTable, const VkStridedBufferRegionKHR* pMissShaderBindingTable, const VkStridedBufferRegionKHR* pHitShaderBindingTable, const VkStridedBufferRegionKHR* pCallableShaderBindingTable, uint32_t width, uint32_t height, uint32_t depth) { }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR VkResult VKAPI_CALL StubCreateRayTracingPipelinesKHR(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) { return VK_SUCCESS; }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR VkDeviceAddress VKAPI_CALL StubGetAccelerationStructureDeviceAddressKHR(VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR* pInfo) { return 0L; }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR VkResult VKAPI_CALL StubGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData) { return VK_SUCCESS; }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR void VKAPI_CALL StubCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, const VkStridedBufferRegionKHR* pRaygenShaderBindingTable, const VkStridedBufferRegionKHR* pMissShaderBindingTable, const VkStridedBufferRegionKHR* pHitShaderBindingTable, const VkStridedBufferRegionKHR* pCallableShaderBindingTable, VkBuffer buffer, VkDeviceSize offset) { }; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +static VKAPI_ATTR VkResult VKAPI_CALL StubGetDeviceAccelerationStructureCompatibilityKHR(VkDevice device, const VkAccelerationStructureVersionKHR* version) { return VK_SUCCESS; }; +#endif // VK_ENABLE_BETA_EXTENSIONS @@ -466,12 +560,44 @@ static inline void layer_init_device_dispatch_table(VkDevice device, VkLayerDisp if (table->GetBufferOpaqueCaptureAddressKHR == nullptr) { table->GetBufferOpaqueCaptureAddressKHR = (PFN_vkGetBufferOpaqueCaptureAddressKHR)StubGetBufferOpaqueCaptureAddressKHR; } table->GetDeviceMemoryOpaqueCaptureAddressKHR = (PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR) gpa(device, "vkGetDeviceMemoryOpaqueCaptureAddressKHR"); if (table->GetDeviceMemoryOpaqueCaptureAddressKHR == nullptr) { table->GetDeviceMemoryOpaqueCaptureAddressKHR = (PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR)StubGetDeviceMemoryOpaqueCaptureAddressKHR; } +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CreateDeferredOperationKHR = (PFN_vkCreateDeferredOperationKHR) gpa(device, "vkCreateDeferredOperationKHR"); + if (table->CreateDeferredOperationKHR == nullptr) { table->CreateDeferredOperationKHR = (PFN_vkCreateDeferredOperationKHR)StubCreateDeferredOperationKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->DestroyDeferredOperationKHR = (PFN_vkDestroyDeferredOperationKHR) gpa(device, "vkDestroyDeferredOperationKHR"); + if (table->DestroyDeferredOperationKHR == nullptr) { table->DestroyDeferredOperationKHR = (PFN_vkDestroyDeferredOperationKHR)StubDestroyDeferredOperationKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->GetDeferredOperationMaxConcurrencyKHR = (PFN_vkGetDeferredOperationMaxConcurrencyKHR) gpa(device, "vkGetDeferredOperationMaxConcurrencyKHR"); + if (table->GetDeferredOperationMaxConcurrencyKHR == nullptr) { table->GetDeferredOperationMaxConcurrencyKHR = (PFN_vkGetDeferredOperationMaxConcurrencyKHR)StubGetDeferredOperationMaxConcurrencyKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->GetDeferredOperationResultKHR = (PFN_vkGetDeferredOperationResultKHR) gpa(device, "vkGetDeferredOperationResultKHR"); + if (table->GetDeferredOperationResultKHR == nullptr) { table->GetDeferredOperationResultKHR = (PFN_vkGetDeferredOperationResultKHR)StubGetDeferredOperationResultKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->DeferredOperationJoinKHR = (PFN_vkDeferredOperationJoinKHR) gpa(device, "vkDeferredOperationJoinKHR"); + if (table->DeferredOperationJoinKHR == nullptr) { table->DeferredOperationJoinKHR = (PFN_vkDeferredOperationJoinKHR)StubDeferredOperationJoinKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS table->GetPipelineExecutablePropertiesKHR = (PFN_vkGetPipelineExecutablePropertiesKHR) gpa(device, "vkGetPipelineExecutablePropertiesKHR"); if (table->GetPipelineExecutablePropertiesKHR == nullptr) { table->GetPipelineExecutablePropertiesKHR = (PFN_vkGetPipelineExecutablePropertiesKHR)StubGetPipelineExecutablePropertiesKHR; } table->GetPipelineExecutableStatisticsKHR = (PFN_vkGetPipelineExecutableStatisticsKHR) gpa(device, "vkGetPipelineExecutableStatisticsKHR"); if (table->GetPipelineExecutableStatisticsKHR == nullptr) { table->GetPipelineExecutableStatisticsKHR = (PFN_vkGetPipelineExecutableStatisticsKHR)StubGetPipelineExecutableStatisticsKHR; } table->GetPipelineExecutableInternalRepresentationsKHR = (PFN_vkGetPipelineExecutableInternalRepresentationsKHR) gpa(device, "vkGetPipelineExecutableInternalRepresentationsKHR"); if (table->GetPipelineExecutableInternalRepresentationsKHR == nullptr) { table->GetPipelineExecutableInternalRepresentationsKHR = (PFN_vkGetPipelineExecutableInternalRepresentationsKHR)StubGetPipelineExecutableInternalRepresentationsKHR; } + table->CmdCopyBuffer2KHR = (PFN_vkCmdCopyBuffer2KHR) gpa(device, "vkCmdCopyBuffer2KHR"); + if (table->CmdCopyBuffer2KHR == nullptr) { table->CmdCopyBuffer2KHR = (PFN_vkCmdCopyBuffer2KHR)StubCmdCopyBuffer2KHR; } + table->CmdCopyImage2KHR = (PFN_vkCmdCopyImage2KHR) gpa(device, "vkCmdCopyImage2KHR"); + if (table->CmdCopyImage2KHR == nullptr) { table->CmdCopyImage2KHR = (PFN_vkCmdCopyImage2KHR)StubCmdCopyImage2KHR; } + table->CmdCopyBufferToImage2KHR = (PFN_vkCmdCopyBufferToImage2KHR) gpa(device, "vkCmdCopyBufferToImage2KHR"); + if (table->CmdCopyBufferToImage2KHR == nullptr) { table->CmdCopyBufferToImage2KHR = (PFN_vkCmdCopyBufferToImage2KHR)StubCmdCopyBufferToImage2KHR; } + table->CmdCopyImageToBuffer2KHR = (PFN_vkCmdCopyImageToBuffer2KHR) gpa(device, "vkCmdCopyImageToBuffer2KHR"); + if (table->CmdCopyImageToBuffer2KHR == nullptr) { table->CmdCopyImageToBuffer2KHR = (PFN_vkCmdCopyImageToBuffer2KHR)StubCmdCopyImageToBuffer2KHR; } + table->CmdBlitImage2KHR = (PFN_vkCmdBlitImage2KHR) gpa(device, "vkCmdBlitImage2KHR"); + if (table->CmdBlitImage2KHR == nullptr) { table->CmdBlitImage2KHR = (PFN_vkCmdBlitImage2KHR)StubCmdBlitImage2KHR; } + table->CmdResolveImage2KHR = (PFN_vkCmdResolveImage2KHR) gpa(device, "vkCmdResolveImage2KHR"); + if (table->CmdResolveImage2KHR == nullptr) { table->CmdResolveImage2KHR = (PFN_vkCmdResolveImage2KHR)StubCmdResolveImage2KHR; } table->DebugMarkerSetObjectTagEXT = (PFN_vkDebugMarkerSetObjectTagEXT) gpa(device, "vkDebugMarkerSetObjectTagEXT"); if (table->DebugMarkerSetObjectTagEXT == nullptr) { table->DebugMarkerSetObjectTagEXT = (PFN_vkDebugMarkerSetObjectTagEXT)StubDebugMarkerSetObjectTagEXT; } table->DebugMarkerSetObjectNameEXT = (PFN_vkDebugMarkerSetObjectNameEXT) gpa(device, "vkDebugMarkerSetObjectNameEXT"); @@ -496,6 +622,8 @@ static inline void layer_init_device_dispatch_table(VkDevice device, VkLayerDisp if (table->CmdDrawIndirectByteCountEXT == nullptr) { table->CmdDrawIndirectByteCountEXT = (PFN_vkCmdDrawIndirectByteCountEXT)StubCmdDrawIndirectByteCountEXT; } table->GetImageViewHandleNVX = (PFN_vkGetImageViewHandleNVX) gpa(device, "vkGetImageViewHandleNVX"); if (table->GetImageViewHandleNVX == nullptr) { table->GetImageViewHandleNVX = (PFN_vkGetImageViewHandleNVX)StubGetImageViewHandleNVX; } + table->GetImageViewAddressNVX = (PFN_vkGetImageViewAddressNVX) gpa(device, "vkGetImageViewAddressNVX"); + if (table->GetImageViewAddressNVX == nullptr) { table->GetImageViewAddressNVX = (PFN_vkGetImageViewAddressNVX)StubGetImageViewAddressNVX; } table->CmdDrawIndirectCountAMD = (PFN_vkCmdDrawIndirectCountAMD) gpa(device, "vkCmdDrawIndirectCountAMD"); if (table->CmdDrawIndirectCountAMD == nullptr) { table->CmdDrawIndirectCountAMD = (PFN_vkCmdDrawIndirectCountAMD)StubCmdDrawIndirectCountAMD; } table->CmdDrawIndexedIndirectCountAMD = (PFN_vkCmdDrawIndexedIndirectCountAMD) gpa(device, "vkCmdDrawIndexedIndirectCountAMD"); @@ -510,22 +638,6 @@ static inline void layer_init_device_dispatch_table(VkDevice device, VkLayerDisp if (table->CmdBeginConditionalRenderingEXT == nullptr) { table->CmdBeginConditionalRenderingEXT = (PFN_vkCmdBeginConditionalRenderingEXT)StubCmdBeginConditionalRenderingEXT; } table->CmdEndConditionalRenderingEXT = (PFN_vkCmdEndConditionalRenderingEXT) gpa(device, "vkCmdEndConditionalRenderingEXT"); if (table->CmdEndConditionalRenderingEXT == nullptr) { table->CmdEndConditionalRenderingEXT = (PFN_vkCmdEndConditionalRenderingEXT)StubCmdEndConditionalRenderingEXT; } - table->CmdProcessCommandsNVX = (PFN_vkCmdProcessCommandsNVX) gpa(device, "vkCmdProcessCommandsNVX"); - if (table->CmdProcessCommandsNVX == nullptr) { table->CmdProcessCommandsNVX = (PFN_vkCmdProcessCommandsNVX)StubCmdProcessCommandsNVX; } - table->CmdReserveSpaceForCommandsNVX = (PFN_vkCmdReserveSpaceForCommandsNVX) gpa(device, "vkCmdReserveSpaceForCommandsNVX"); - if (table->CmdReserveSpaceForCommandsNVX == nullptr) { table->CmdReserveSpaceForCommandsNVX = (PFN_vkCmdReserveSpaceForCommandsNVX)StubCmdReserveSpaceForCommandsNVX; } - table->CreateIndirectCommandsLayoutNVX = (PFN_vkCreateIndirectCommandsLayoutNVX) gpa(device, "vkCreateIndirectCommandsLayoutNVX"); - if (table->CreateIndirectCommandsLayoutNVX == nullptr) { table->CreateIndirectCommandsLayoutNVX = (PFN_vkCreateIndirectCommandsLayoutNVX)StubCreateIndirectCommandsLayoutNVX; } - table->DestroyIndirectCommandsLayoutNVX = (PFN_vkDestroyIndirectCommandsLayoutNVX) gpa(device, "vkDestroyIndirectCommandsLayoutNVX"); - if (table->DestroyIndirectCommandsLayoutNVX == nullptr) { table->DestroyIndirectCommandsLayoutNVX = (PFN_vkDestroyIndirectCommandsLayoutNVX)StubDestroyIndirectCommandsLayoutNVX; } - table->CreateObjectTableNVX = (PFN_vkCreateObjectTableNVX) gpa(device, "vkCreateObjectTableNVX"); - if (table->CreateObjectTableNVX == nullptr) { table->CreateObjectTableNVX = (PFN_vkCreateObjectTableNVX)StubCreateObjectTableNVX; } - table->DestroyObjectTableNVX = (PFN_vkDestroyObjectTableNVX) gpa(device, "vkDestroyObjectTableNVX"); - if (table->DestroyObjectTableNVX == nullptr) { table->DestroyObjectTableNVX = (PFN_vkDestroyObjectTableNVX)StubDestroyObjectTableNVX; } - table->RegisterObjectsNVX = (PFN_vkRegisterObjectsNVX) gpa(device, "vkRegisterObjectsNVX"); - if (table->RegisterObjectsNVX == nullptr) { table->RegisterObjectsNVX = (PFN_vkRegisterObjectsNVX)StubRegisterObjectsNVX; } - table->UnregisterObjectsNVX = (PFN_vkUnregisterObjectsNVX) gpa(device, "vkUnregisterObjectsNVX"); - if (table->UnregisterObjectsNVX == nullptr) { table->UnregisterObjectsNVX = (PFN_vkUnregisterObjectsNVX)StubUnregisterObjectsNVX; } table->CmdSetViewportWScalingNV = (PFN_vkCmdSetViewportWScalingNV) gpa(device, "vkCmdSetViewportWScalingNV"); if (table->CmdSetViewportWScalingNV == nullptr) { table->CmdSetViewportWScalingNV = (PFN_vkCmdSetViewportWScalingNV)StubCmdSetViewportWScalingNV; } table->DisplayPowerControlEXT = (PFN_vkDisplayPowerControlEXT) gpa(device, "vkDisplayPowerControlEXT"); @@ -580,10 +692,14 @@ static inline void layer_init_device_dispatch_table(VkDevice device, VkLayerDisp if (table->CmdSetCoarseSampleOrderNV == nullptr) { table->CmdSetCoarseSampleOrderNV = (PFN_vkCmdSetCoarseSampleOrderNV)StubCmdSetCoarseSampleOrderNV; } table->CreateAccelerationStructureNV = (PFN_vkCreateAccelerationStructureNV) gpa(device, "vkCreateAccelerationStructureNV"); if (table->CreateAccelerationStructureNV == nullptr) { table->CreateAccelerationStructureNV = (PFN_vkCreateAccelerationStructureNV)StubCreateAccelerationStructureNV; } + table->DestroyAccelerationStructureKHR = (PFN_vkDestroyAccelerationStructureKHR) gpa(device, "vkDestroyAccelerationStructureKHR"); + if (table->DestroyAccelerationStructureKHR == nullptr) { table->DestroyAccelerationStructureKHR = (PFN_vkDestroyAccelerationStructureKHR)StubDestroyAccelerationStructureKHR; } table->DestroyAccelerationStructureNV = (PFN_vkDestroyAccelerationStructureNV) gpa(device, "vkDestroyAccelerationStructureNV"); if (table->DestroyAccelerationStructureNV == nullptr) { table->DestroyAccelerationStructureNV = (PFN_vkDestroyAccelerationStructureNV)StubDestroyAccelerationStructureNV; } table->GetAccelerationStructureMemoryRequirementsNV = (PFN_vkGetAccelerationStructureMemoryRequirementsNV) gpa(device, "vkGetAccelerationStructureMemoryRequirementsNV"); if (table->GetAccelerationStructureMemoryRequirementsNV == nullptr) { table->GetAccelerationStructureMemoryRequirementsNV = (PFN_vkGetAccelerationStructureMemoryRequirementsNV)StubGetAccelerationStructureMemoryRequirementsNV; } + table->BindAccelerationStructureMemoryKHR = (PFN_vkBindAccelerationStructureMemoryKHR) gpa(device, "vkBindAccelerationStructureMemoryKHR"); + if (table->BindAccelerationStructureMemoryKHR == nullptr) { table->BindAccelerationStructureMemoryKHR = (PFN_vkBindAccelerationStructureMemoryKHR)StubBindAccelerationStructureMemoryKHR; } table->BindAccelerationStructureMemoryNV = (PFN_vkBindAccelerationStructureMemoryNV) gpa(device, "vkBindAccelerationStructureMemoryNV"); if (table->BindAccelerationStructureMemoryNV == nullptr) { table->BindAccelerationStructureMemoryNV = (PFN_vkBindAccelerationStructureMemoryNV)StubBindAccelerationStructureMemoryNV; } table->CmdBuildAccelerationStructureNV = (PFN_vkCmdBuildAccelerationStructureNV) gpa(device, "vkCmdBuildAccelerationStructureNV"); @@ -594,10 +710,14 @@ static inline void layer_init_device_dispatch_table(VkDevice device, VkLayerDisp if (table->CmdTraceRaysNV == nullptr) { table->CmdTraceRaysNV = (PFN_vkCmdTraceRaysNV)StubCmdTraceRaysNV; } table->CreateRayTracingPipelinesNV = (PFN_vkCreateRayTracingPipelinesNV) gpa(device, "vkCreateRayTracingPipelinesNV"); if (table->CreateRayTracingPipelinesNV == nullptr) { table->CreateRayTracingPipelinesNV = (PFN_vkCreateRayTracingPipelinesNV)StubCreateRayTracingPipelinesNV; } + table->GetRayTracingShaderGroupHandlesKHR = (PFN_vkGetRayTracingShaderGroupHandlesKHR) gpa(device, "vkGetRayTracingShaderGroupHandlesKHR"); + if (table->GetRayTracingShaderGroupHandlesKHR == nullptr) { table->GetRayTracingShaderGroupHandlesKHR = (PFN_vkGetRayTracingShaderGroupHandlesKHR)StubGetRayTracingShaderGroupHandlesKHR; } table->GetRayTracingShaderGroupHandlesNV = (PFN_vkGetRayTracingShaderGroupHandlesNV) gpa(device, "vkGetRayTracingShaderGroupHandlesNV"); if (table->GetRayTracingShaderGroupHandlesNV == nullptr) { table->GetRayTracingShaderGroupHandlesNV = (PFN_vkGetRayTracingShaderGroupHandlesNV)StubGetRayTracingShaderGroupHandlesNV; } table->GetAccelerationStructureHandleNV = (PFN_vkGetAccelerationStructureHandleNV) gpa(device, "vkGetAccelerationStructureHandleNV"); if (table->GetAccelerationStructureHandleNV == nullptr) { table->GetAccelerationStructureHandleNV = (PFN_vkGetAccelerationStructureHandleNV)StubGetAccelerationStructureHandleNV; } + table->CmdWriteAccelerationStructuresPropertiesKHR = (PFN_vkCmdWriteAccelerationStructuresPropertiesKHR) gpa(device, "vkCmdWriteAccelerationStructuresPropertiesKHR"); + if (table->CmdWriteAccelerationStructuresPropertiesKHR == nullptr) { table->CmdWriteAccelerationStructuresPropertiesKHR = (PFN_vkCmdWriteAccelerationStructuresPropertiesKHR)StubCmdWriteAccelerationStructuresPropertiesKHR; } table->CmdWriteAccelerationStructuresPropertiesNV = (PFN_vkCmdWriteAccelerationStructuresPropertiesNV) gpa(device, "vkCmdWriteAccelerationStructuresPropertiesNV"); if (table->CmdWriteAccelerationStructuresPropertiesNV == nullptr) { table->CmdWriteAccelerationStructuresPropertiesNV = (PFN_vkCmdWriteAccelerationStructuresPropertiesNV)StubCmdWriteAccelerationStructuresPropertiesNV; } table->CompileDeferredNV = (PFN_vkCompileDeferredNV) gpa(device, "vkCompileDeferredNV"); @@ -658,6 +778,122 @@ static inline void layer_init_device_dispatch_table(VkDevice device, VkLayerDisp if (table->CmdSetLineStippleEXT == nullptr) { table->CmdSetLineStippleEXT = (PFN_vkCmdSetLineStippleEXT)StubCmdSetLineStippleEXT; } table->ResetQueryPoolEXT = (PFN_vkResetQueryPoolEXT) gpa(device, "vkResetQueryPoolEXT"); if (table->ResetQueryPoolEXT == nullptr) { table->ResetQueryPoolEXT = (PFN_vkResetQueryPoolEXT)StubResetQueryPoolEXT; } + table->CmdSetCullModeEXT = (PFN_vkCmdSetCullModeEXT) gpa(device, "vkCmdSetCullModeEXT"); + if (table->CmdSetCullModeEXT == nullptr) { table->CmdSetCullModeEXT = (PFN_vkCmdSetCullModeEXT)StubCmdSetCullModeEXT; } + table->CmdSetFrontFaceEXT = (PFN_vkCmdSetFrontFaceEXT) gpa(device, "vkCmdSetFrontFaceEXT"); + if (table->CmdSetFrontFaceEXT == nullptr) { table->CmdSetFrontFaceEXT = (PFN_vkCmdSetFrontFaceEXT)StubCmdSetFrontFaceEXT; } + table->CmdSetPrimitiveTopologyEXT = (PFN_vkCmdSetPrimitiveTopologyEXT) gpa(device, "vkCmdSetPrimitiveTopologyEXT"); + if (table->CmdSetPrimitiveTopologyEXT == nullptr) { table->CmdSetPrimitiveTopologyEXT = (PFN_vkCmdSetPrimitiveTopologyEXT)StubCmdSetPrimitiveTopologyEXT; } + table->CmdSetViewportWithCountEXT = (PFN_vkCmdSetViewportWithCountEXT) gpa(device, "vkCmdSetViewportWithCountEXT"); + if (table->CmdSetViewportWithCountEXT == nullptr) { table->CmdSetViewportWithCountEXT = (PFN_vkCmdSetViewportWithCountEXT)StubCmdSetViewportWithCountEXT; } + table->CmdSetScissorWithCountEXT = (PFN_vkCmdSetScissorWithCountEXT) gpa(device, "vkCmdSetScissorWithCountEXT"); + if (table->CmdSetScissorWithCountEXT == nullptr) { table->CmdSetScissorWithCountEXT = (PFN_vkCmdSetScissorWithCountEXT)StubCmdSetScissorWithCountEXT; } + table->CmdBindVertexBuffers2EXT = (PFN_vkCmdBindVertexBuffers2EXT) gpa(device, "vkCmdBindVertexBuffers2EXT"); + if (table->CmdBindVertexBuffers2EXT == nullptr) { table->CmdBindVertexBuffers2EXT = (PFN_vkCmdBindVertexBuffers2EXT)StubCmdBindVertexBuffers2EXT; } + table->CmdSetDepthTestEnableEXT = (PFN_vkCmdSetDepthTestEnableEXT) gpa(device, "vkCmdSetDepthTestEnableEXT"); + if (table->CmdSetDepthTestEnableEXT == nullptr) { table->CmdSetDepthTestEnableEXT = (PFN_vkCmdSetDepthTestEnableEXT)StubCmdSetDepthTestEnableEXT; } + table->CmdSetDepthWriteEnableEXT = (PFN_vkCmdSetDepthWriteEnableEXT) gpa(device, "vkCmdSetDepthWriteEnableEXT"); + if (table->CmdSetDepthWriteEnableEXT == nullptr) { table->CmdSetDepthWriteEnableEXT = (PFN_vkCmdSetDepthWriteEnableEXT)StubCmdSetDepthWriteEnableEXT; } + table->CmdSetDepthCompareOpEXT = (PFN_vkCmdSetDepthCompareOpEXT) gpa(device, "vkCmdSetDepthCompareOpEXT"); + if (table->CmdSetDepthCompareOpEXT == nullptr) { table->CmdSetDepthCompareOpEXT = (PFN_vkCmdSetDepthCompareOpEXT)StubCmdSetDepthCompareOpEXT; } + table->CmdSetDepthBoundsTestEnableEXT = (PFN_vkCmdSetDepthBoundsTestEnableEXT) gpa(device, "vkCmdSetDepthBoundsTestEnableEXT"); + if (table->CmdSetDepthBoundsTestEnableEXT == nullptr) { table->CmdSetDepthBoundsTestEnableEXT = (PFN_vkCmdSetDepthBoundsTestEnableEXT)StubCmdSetDepthBoundsTestEnableEXT; } + table->CmdSetStencilTestEnableEXT = (PFN_vkCmdSetStencilTestEnableEXT) gpa(device, "vkCmdSetStencilTestEnableEXT"); + if (table->CmdSetStencilTestEnableEXT == nullptr) { table->CmdSetStencilTestEnableEXT = (PFN_vkCmdSetStencilTestEnableEXT)StubCmdSetStencilTestEnableEXT; } + table->CmdSetStencilOpEXT = (PFN_vkCmdSetStencilOpEXT) gpa(device, "vkCmdSetStencilOpEXT"); + if (table->CmdSetStencilOpEXT == nullptr) { table->CmdSetStencilOpEXT = (PFN_vkCmdSetStencilOpEXT)StubCmdSetStencilOpEXT; } + table->GetGeneratedCommandsMemoryRequirementsNV = (PFN_vkGetGeneratedCommandsMemoryRequirementsNV) gpa(device, "vkGetGeneratedCommandsMemoryRequirementsNV"); + if (table->GetGeneratedCommandsMemoryRequirementsNV == nullptr) { table->GetGeneratedCommandsMemoryRequirementsNV = (PFN_vkGetGeneratedCommandsMemoryRequirementsNV)StubGetGeneratedCommandsMemoryRequirementsNV; } + table->CmdPreprocessGeneratedCommandsNV = (PFN_vkCmdPreprocessGeneratedCommandsNV) gpa(device, "vkCmdPreprocessGeneratedCommandsNV"); + if (table->CmdPreprocessGeneratedCommandsNV == nullptr) { table->CmdPreprocessGeneratedCommandsNV = (PFN_vkCmdPreprocessGeneratedCommandsNV)StubCmdPreprocessGeneratedCommandsNV; } + table->CmdExecuteGeneratedCommandsNV = (PFN_vkCmdExecuteGeneratedCommandsNV) gpa(device, "vkCmdExecuteGeneratedCommandsNV"); + if (table->CmdExecuteGeneratedCommandsNV == nullptr) { table->CmdExecuteGeneratedCommandsNV = (PFN_vkCmdExecuteGeneratedCommandsNV)StubCmdExecuteGeneratedCommandsNV; } + table->CmdBindPipelineShaderGroupNV = (PFN_vkCmdBindPipelineShaderGroupNV) gpa(device, "vkCmdBindPipelineShaderGroupNV"); + if (table->CmdBindPipelineShaderGroupNV == nullptr) { table->CmdBindPipelineShaderGroupNV = (PFN_vkCmdBindPipelineShaderGroupNV)StubCmdBindPipelineShaderGroupNV; } + table->CreateIndirectCommandsLayoutNV = (PFN_vkCreateIndirectCommandsLayoutNV) gpa(device, "vkCreateIndirectCommandsLayoutNV"); + if (table->CreateIndirectCommandsLayoutNV == nullptr) { table->CreateIndirectCommandsLayoutNV = (PFN_vkCreateIndirectCommandsLayoutNV)StubCreateIndirectCommandsLayoutNV; } + table->DestroyIndirectCommandsLayoutNV = (PFN_vkDestroyIndirectCommandsLayoutNV) gpa(device, "vkDestroyIndirectCommandsLayoutNV"); + if (table->DestroyIndirectCommandsLayoutNV == nullptr) { table->DestroyIndirectCommandsLayoutNV = (PFN_vkDestroyIndirectCommandsLayoutNV)StubDestroyIndirectCommandsLayoutNV; } + table->CreatePrivateDataSlotEXT = (PFN_vkCreatePrivateDataSlotEXT) gpa(device, "vkCreatePrivateDataSlotEXT"); + if (table->CreatePrivateDataSlotEXT == nullptr) { table->CreatePrivateDataSlotEXT = (PFN_vkCreatePrivateDataSlotEXT)StubCreatePrivateDataSlotEXT; } + table->DestroyPrivateDataSlotEXT = (PFN_vkDestroyPrivateDataSlotEXT) gpa(device, "vkDestroyPrivateDataSlotEXT"); + if (table->DestroyPrivateDataSlotEXT == nullptr) { table->DestroyPrivateDataSlotEXT = (PFN_vkDestroyPrivateDataSlotEXT)StubDestroyPrivateDataSlotEXT; } + table->SetPrivateDataEXT = (PFN_vkSetPrivateDataEXT) gpa(device, "vkSetPrivateDataEXT"); + if (table->SetPrivateDataEXT == nullptr) { table->SetPrivateDataEXT = (PFN_vkSetPrivateDataEXT)StubSetPrivateDataEXT; } + table->GetPrivateDataEXT = (PFN_vkGetPrivateDataEXT) gpa(device, "vkGetPrivateDataEXT"); + if (table->GetPrivateDataEXT == nullptr) { table->GetPrivateDataEXT = (PFN_vkGetPrivateDataEXT)StubGetPrivateDataEXT; } +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CreateAccelerationStructureKHR = (PFN_vkCreateAccelerationStructureKHR) gpa(device, "vkCreateAccelerationStructureKHR"); + if (table->CreateAccelerationStructureKHR == nullptr) { table->CreateAccelerationStructureKHR = (PFN_vkCreateAccelerationStructureKHR)StubCreateAccelerationStructureKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->GetAccelerationStructureMemoryRequirementsKHR = (PFN_vkGetAccelerationStructureMemoryRequirementsKHR) gpa(device, "vkGetAccelerationStructureMemoryRequirementsKHR"); + if (table->GetAccelerationStructureMemoryRequirementsKHR == nullptr) { table->GetAccelerationStructureMemoryRequirementsKHR = (PFN_vkGetAccelerationStructureMemoryRequirementsKHR)StubGetAccelerationStructureMemoryRequirementsKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdBuildAccelerationStructureKHR = (PFN_vkCmdBuildAccelerationStructureKHR) gpa(device, "vkCmdBuildAccelerationStructureKHR"); + if (table->CmdBuildAccelerationStructureKHR == nullptr) { table->CmdBuildAccelerationStructureKHR = (PFN_vkCmdBuildAccelerationStructureKHR)StubCmdBuildAccelerationStructureKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdBuildAccelerationStructureIndirectKHR = (PFN_vkCmdBuildAccelerationStructureIndirectKHR) gpa(device, "vkCmdBuildAccelerationStructureIndirectKHR"); + if (table->CmdBuildAccelerationStructureIndirectKHR == nullptr) { table->CmdBuildAccelerationStructureIndirectKHR = (PFN_vkCmdBuildAccelerationStructureIndirectKHR)StubCmdBuildAccelerationStructureIndirectKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->BuildAccelerationStructureKHR = (PFN_vkBuildAccelerationStructureKHR) gpa(device, "vkBuildAccelerationStructureKHR"); + if (table->BuildAccelerationStructureKHR == nullptr) { table->BuildAccelerationStructureKHR = (PFN_vkBuildAccelerationStructureKHR)StubBuildAccelerationStructureKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CopyAccelerationStructureKHR = (PFN_vkCopyAccelerationStructureKHR) gpa(device, "vkCopyAccelerationStructureKHR"); + if (table->CopyAccelerationStructureKHR == nullptr) { table->CopyAccelerationStructureKHR = (PFN_vkCopyAccelerationStructureKHR)StubCopyAccelerationStructureKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CopyAccelerationStructureToMemoryKHR = (PFN_vkCopyAccelerationStructureToMemoryKHR) gpa(device, "vkCopyAccelerationStructureToMemoryKHR"); + if (table->CopyAccelerationStructureToMemoryKHR == nullptr) { table->CopyAccelerationStructureToMemoryKHR = (PFN_vkCopyAccelerationStructureToMemoryKHR)StubCopyAccelerationStructureToMemoryKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CopyMemoryToAccelerationStructureKHR = (PFN_vkCopyMemoryToAccelerationStructureKHR) gpa(device, "vkCopyMemoryToAccelerationStructureKHR"); + if (table->CopyMemoryToAccelerationStructureKHR == nullptr) { table->CopyMemoryToAccelerationStructureKHR = (PFN_vkCopyMemoryToAccelerationStructureKHR)StubCopyMemoryToAccelerationStructureKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->WriteAccelerationStructuresPropertiesKHR = (PFN_vkWriteAccelerationStructuresPropertiesKHR) gpa(device, "vkWriteAccelerationStructuresPropertiesKHR"); + if (table->WriteAccelerationStructuresPropertiesKHR == nullptr) { table->WriteAccelerationStructuresPropertiesKHR = (PFN_vkWriteAccelerationStructuresPropertiesKHR)StubWriteAccelerationStructuresPropertiesKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdCopyAccelerationStructureKHR = (PFN_vkCmdCopyAccelerationStructureKHR) gpa(device, "vkCmdCopyAccelerationStructureKHR"); + if (table->CmdCopyAccelerationStructureKHR == nullptr) { table->CmdCopyAccelerationStructureKHR = (PFN_vkCmdCopyAccelerationStructureKHR)StubCmdCopyAccelerationStructureKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdCopyAccelerationStructureToMemoryKHR = (PFN_vkCmdCopyAccelerationStructureToMemoryKHR) gpa(device, "vkCmdCopyAccelerationStructureToMemoryKHR"); + if (table->CmdCopyAccelerationStructureToMemoryKHR == nullptr) { table->CmdCopyAccelerationStructureToMemoryKHR = (PFN_vkCmdCopyAccelerationStructureToMemoryKHR)StubCmdCopyAccelerationStructureToMemoryKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdCopyMemoryToAccelerationStructureKHR = (PFN_vkCmdCopyMemoryToAccelerationStructureKHR) gpa(device, "vkCmdCopyMemoryToAccelerationStructureKHR"); + if (table->CmdCopyMemoryToAccelerationStructureKHR == nullptr) { table->CmdCopyMemoryToAccelerationStructureKHR = (PFN_vkCmdCopyMemoryToAccelerationStructureKHR)StubCmdCopyMemoryToAccelerationStructureKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdTraceRaysKHR = (PFN_vkCmdTraceRaysKHR) gpa(device, "vkCmdTraceRaysKHR"); + if (table->CmdTraceRaysKHR == nullptr) { table->CmdTraceRaysKHR = (PFN_vkCmdTraceRaysKHR)StubCmdTraceRaysKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CreateRayTracingPipelinesKHR = (PFN_vkCreateRayTracingPipelinesKHR) gpa(device, "vkCreateRayTracingPipelinesKHR"); + if (table->CreateRayTracingPipelinesKHR == nullptr) { table->CreateRayTracingPipelinesKHR = (PFN_vkCreateRayTracingPipelinesKHR)StubCreateRayTracingPipelinesKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->GetAccelerationStructureDeviceAddressKHR = (PFN_vkGetAccelerationStructureDeviceAddressKHR) gpa(device, "vkGetAccelerationStructureDeviceAddressKHR"); + if (table->GetAccelerationStructureDeviceAddressKHR == nullptr) { table->GetAccelerationStructureDeviceAddressKHR = (PFN_vkGetAccelerationStructureDeviceAddressKHR)StubGetAccelerationStructureDeviceAddressKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->GetRayTracingCaptureReplayShaderGroupHandlesKHR = (PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR) gpa(device, "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR"); + if (table->GetRayTracingCaptureReplayShaderGroupHandlesKHR == nullptr) { table->GetRayTracingCaptureReplayShaderGroupHandlesKHR = (PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR)StubGetRayTracingCaptureReplayShaderGroupHandlesKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdTraceRaysIndirectKHR = (PFN_vkCmdTraceRaysIndirectKHR) gpa(device, "vkCmdTraceRaysIndirectKHR"); + if (table->CmdTraceRaysIndirectKHR == nullptr) { table->CmdTraceRaysIndirectKHR = (PFN_vkCmdTraceRaysIndirectKHR)StubCmdTraceRaysIndirectKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->GetDeviceAccelerationStructureCompatibilityKHR = (PFN_vkGetDeviceAccelerationStructureCompatibilityKHR) gpa(device, "vkGetDeviceAccelerationStructureCompatibilityKHR"); + if (table->GetDeviceAccelerationStructureCompatibilityKHR == nullptr) { table->GetDeviceAccelerationStructureCompatibilityKHR = (PFN_vkGetDeviceAccelerationStructureCompatibilityKHR)StubGetDeviceAccelerationStructureCompatibilityKHR; } +#endif // VK_ENABLE_BETA_EXTENSIONS } @@ -756,7 +992,6 @@ static inline void layer_init_instance_dispatch_table(VkInstance instance, VkLay #ifdef VK_USE_PLATFORM_VI_NN table->CreateViSurfaceNN = (PFN_vkCreateViSurfaceNN) gpa(instance, "vkCreateViSurfaceNN"); #endif // VK_USE_PLATFORM_VI_NN - table->GetPhysicalDeviceGeneratedCommandsPropertiesNVX = (PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX) gpa(instance, "vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX"); table->ReleaseDisplayEXT = (PFN_vkReleaseDisplayEXT) gpa(instance, "vkReleaseDisplayEXT"); #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT table->AcquireXlibDisplayEXT = (PFN_vkAcquireXlibDisplayEXT) gpa(instance, "vkAcquireXlibDisplayEXT"); @@ -789,4 +1024,10 @@ static inline void layer_init_instance_dispatch_table(VkInstance instance, VkLay table->GetPhysicalDeviceSurfacePresentModes2EXT = (PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT) gpa(instance, "vkGetPhysicalDeviceSurfacePresentModes2EXT"); #endif // VK_USE_PLATFORM_WIN32_KHR table->CreateHeadlessSurfaceEXT = (PFN_vkCreateHeadlessSurfaceEXT) gpa(instance, "vkCreateHeadlessSurfaceEXT"); +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + table->CreateDirectFBSurfaceEXT = (PFN_vkCreateDirectFBSurfaceEXT) gpa(instance, "vkCreateDirectFBSurfaceEXT"); +#endif // VK_USE_PLATFORM_DIRECTFB_EXT +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + table->GetPhysicalDeviceDirectFBPresentationSupportEXT = (PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT) gpa(instance, "vkGetPhysicalDeviceDirectFBPresentationSupportEXT"); +#endif // VK_USE_PLATFORM_DIRECTFB_EXT } diff --git a/thirdparty/vulkan/loader/vk_layer_dispatch_table.h b/thirdparty/vulkan/loader/vk_layer_dispatch_table.h index b919447e55..d774098d66 100644 --- a/thirdparty/vulkan/loader/vk_layer_dispatch_table.h +++ b/thirdparty/vulkan/loader/vk_layer_dispatch_table.h @@ -172,9 +172,6 @@ typedef struct VkLayerInstanceDispatchTable_ { PFN_vkCreateViSurfaceNN CreateViSurfaceNN; #endif // VK_USE_PLATFORM_VI_NN - // ---- VK_NVX_device_generated_commands extension commands - PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX GetPhysicalDeviceGeneratedCommandsPropertiesNVX; - // ---- VK_EXT_direct_mode_display extension commands PFN_vkReleaseDisplayEXT ReleaseDisplayEXT; @@ -236,6 +233,14 @@ typedef struct VkLayerInstanceDispatchTable_ { // ---- VK_EXT_headless_surface extension commands PFN_vkCreateHeadlessSurfaceEXT CreateHeadlessSurfaceEXT; + + // ---- VK_EXT_directfb_surface extension commands +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + PFN_vkCreateDirectFBSurfaceEXT CreateDirectFBSurfaceEXT; +#endif // VK_USE_PLATFORM_DIRECTFB_EXT +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT GetPhysicalDeviceDirectFBPresentationSupportEXT; +#endif // VK_USE_PLATFORM_DIRECTFB_EXT } VkLayerInstanceDispatchTable; // Device function pointer dispatch table @@ -506,11 +511,36 @@ typedef struct VkLayerDispatchTable_ { PFN_vkGetBufferOpaqueCaptureAddressKHR GetBufferOpaqueCaptureAddressKHR; PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR GetDeviceMemoryOpaqueCaptureAddressKHR; + // ---- VK_KHR_deferred_host_operations extension commands +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkCreateDeferredOperationKHR CreateDeferredOperationKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkDestroyDeferredOperationKHR DestroyDeferredOperationKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkGetDeferredOperationMaxConcurrencyKHR GetDeferredOperationMaxConcurrencyKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkGetDeferredOperationResultKHR GetDeferredOperationResultKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkDeferredOperationJoinKHR DeferredOperationJoinKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS + // ---- VK_KHR_pipeline_executable_properties extension commands PFN_vkGetPipelineExecutablePropertiesKHR GetPipelineExecutablePropertiesKHR; PFN_vkGetPipelineExecutableStatisticsKHR GetPipelineExecutableStatisticsKHR; PFN_vkGetPipelineExecutableInternalRepresentationsKHR GetPipelineExecutableInternalRepresentationsKHR; + // ---- VK_KHR_copy_commands2 extension commands + PFN_vkCmdCopyBuffer2KHR CmdCopyBuffer2KHR; + PFN_vkCmdCopyImage2KHR CmdCopyImage2KHR; + PFN_vkCmdCopyBufferToImage2KHR CmdCopyBufferToImage2KHR; + PFN_vkCmdCopyImageToBuffer2KHR CmdCopyImageToBuffer2KHR; + PFN_vkCmdBlitImage2KHR CmdBlitImage2KHR; + PFN_vkCmdResolveImage2KHR CmdResolveImage2KHR; + // ---- VK_EXT_debug_marker extension commands PFN_vkDebugMarkerSetObjectTagEXT DebugMarkerSetObjectTagEXT; PFN_vkDebugMarkerSetObjectNameEXT DebugMarkerSetObjectNameEXT; @@ -528,6 +558,7 @@ typedef struct VkLayerDispatchTable_ { // ---- VK_NVX_image_view_handle extension commands PFN_vkGetImageViewHandleNVX GetImageViewHandleNVX; + PFN_vkGetImageViewAddressNVX GetImageViewAddressNVX; // ---- VK_AMD_draw_indirect_count extension commands PFN_vkCmdDrawIndirectCountAMD CmdDrawIndirectCountAMD; @@ -545,16 +576,6 @@ typedef struct VkLayerDispatchTable_ { PFN_vkCmdBeginConditionalRenderingEXT CmdBeginConditionalRenderingEXT; PFN_vkCmdEndConditionalRenderingEXT CmdEndConditionalRenderingEXT; - // ---- VK_NVX_device_generated_commands extension commands - PFN_vkCmdProcessCommandsNVX CmdProcessCommandsNVX; - PFN_vkCmdReserveSpaceForCommandsNVX CmdReserveSpaceForCommandsNVX; - PFN_vkCreateIndirectCommandsLayoutNVX CreateIndirectCommandsLayoutNVX; - PFN_vkDestroyIndirectCommandsLayoutNVX DestroyIndirectCommandsLayoutNVX; - PFN_vkCreateObjectTableNVX CreateObjectTableNVX; - PFN_vkDestroyObjectTableNVX DestroyObjectTableNVX; - PFN_vkRegisterObjectsNVX RegisterObjectsNVX; - PFN_vkUnregisterObjectsNVX UnregisterObjectsNVX; - // ---- VK_NV_clip_space_w_scaling extension commands PFN_vkCmdSetViewportWScalingNV CmdSetViewportWScalingNV; @@ -611,15 +632,19 @@ typedef struct VkLayerDispatchTable_ { // ---- VK_NV_ray_tracing extension commands PFN_vkCreateAccelerationStructureNV CreateAccelerationStructureNV; + PFN_vkDestroyAccelerationStructureKHR DestroyAccelerationStructureKHR; PFN_vkDestroyAccelerationStructureNV DestroyAccelerationStructureNV; PFN_vkGetAccelerationStructureMemoryRequirementsNV GetAccelerationStructureMemoryRequirementsNV; + PFN_vkBindAccelerationStructureMemoryKHR BindAccelerationStructureMemoryKHR; PFN_vkBindAccelerationStructureMemoryNV BindAccelerationStructureMemoryNV; PFN_vkCmdBuildAccelerationStructureNV CmdBuildAccelerationStructureNV; PFN_vkCmdCopyAccelerationStructureNV CmdCopyAccelerationStructureNV; PFN_vkCmdTraceRaysNV CmdTraceRaysNV; PFN_vkCreateRayTracingPipelinesNV CreateRayTracingPipelinesNV; + PFN_vkGetRayTracingShaderGroupHandlesKHR GetRayTracingShaderGroupHandlesKHR; PFN_vkGetRayTracingShaderGroupHandlesNV GetRayTracingShaderGroupHandlesNV; PFN_vkGetAccelerationStructureHandleNV GetAccelerationStructureHandleNV; + PFN_vkCmdWriteAccelerationStructuresPropertiesKHR CmdWriteAccelerationStructuresPropertiesKHR; PFN_vkCmdWriteAccelerationStructuresPropertiesNV CmdWriteAccelerationStructuresPropertiesNV; PFN_vkCompileDeferredNV CompileDeferredNV; @@ -677,6 +702,90 @@ typedef struct VkLayerDispatchTable_ { // ---- VK_EXT_host_query_reset extension commands PFN_vkResetQueryPoolEXT ResetQueryPoolEXT; + + // ---- VK_EXT_extended_dynamic_state extension commands + PFN_vkCmdSetCullModeEXT CmdSetCullModeEXT; + PFN_vkCmdSetFrontFaceEXT CmdSetFrontFaceEXT; + PFN_vkCmdSetPrimitiveTopologyEXT CmdSetPrimitiveTopologyEXT; + PFN_vkCmdSetViewportWithCountEXT CmdSetViewportWithCountEXT; + PFN_vkCmdSetScissorWithCountEXT CmdSetScissorWithCountEXT; + PFN_vkCmdBindVertexBuffers2EXT CmdBindVertexBuffers2EXT; + PFN_vkCmdSetDepthTestEnableEXT CmdSetDepthTestEnableEXT; + PFN_vkCmdSetDepthWriteEnableEXT CmdSetDepthWriteEnableEXT; + PFN_vkCmdSetDepthCompareOpEXT CmdSetDepthCompareOpEXT; + PFN_vkCmdSetDepthBoundsTestEnableEXT CmdSetDepthBoundsTestEnableEXT; + PFN_vkCmdSetStencilTestEnableEXT CmdSetStencilTestEnableEXT; + PFN_vkCmdSetStencilOpEXT CmdSetStencilOpEXT; + + // ---- VK_NV_device_generated_commands extension commands + PFN_vkGetGeneratedCommandsMemoryRequirementsNV GetGeneratedCommandsMemoryRequirementsNV; + PFN_vkCmdPreprocessGeneratedCommandsNV CmdPreprocessGeneratedCommandsNV; + PFN_vkCmdExecuteGeneratedCommandsNV CmdExecuteGeneratedCommandsNV; + PFN_vkCmdBindPipelineShaderGroupNV CmdBindPipelineShaderGroupNV; + PFN_vkCreateIndirectCommandsLayoutNV CreateIndirectCommandsLayoutNV; + PFN_vkDestroyIndirectCommandsLayoutNV DestroyIndirectCommandsLayoutNV; + + // ---- VK_EXT_private_data extension commands + PFN_vkCreatePrivateDataSlotEXT CreatePrivateDataSlotEXT; + PFN_vkDestroyPrivateDataSlotEXT DestroyPrivateDataSlotEXT; + PFN_vkSetPrivateDataEXT SetPrivateDataEXT; + PFN_vkGetPrivateDataEXT GetPrivateDataEXT; + + // ---- VK_KHR_ray_tracing extension commands +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkCreateAccelerationStructureKHR CreateAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkGetAccelerationStructureMemoryRequirementsKHR GetAccelerationStructureMemoryRequirementsKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkCmdBuildAccelerationStructureKHR CmdBuildAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkCmdBuildAccelerationStructureIndirectKHR CmdBuildAccelerationStructureIndirectKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkBuildAccelerationStructureKHR BuildAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkCopyAccelerationStructureKHR CopyAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkCopyAccelerationStructureToMemoryKHR CopyAccelerationStructureToMemoryKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkCopyMemoryToAccelerationStructureKHR CopyMemoryToAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkWriteAccelerationStructuresPropertiesKHR WriteAccelerationStructuresPropertiesKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkCmdCopyAccelerationStructureKHR CmdCopyAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkCmdCopyAccelerationStructureToMemoryKHR CmdCopyAccelerationStructureToMemoryKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkCmdCopyMemoryToAccelerationStructureKHR CmdCopyMemoryToAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkCmdTraceRaysKHR CmdTraceRaysKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkCreateRayTracingPipelinesKHR CreateRayTracingPipelinesKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkGetAccelerationStructureDeviceAddressKHR GetAccelerationStructureDeviceAddressKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR GetRayTracingCaptureReplayShaderGroupHandlesKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkCmdTraceRaysIndirectKHR CmdTraceRaysIndirectKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + PFN_vkGetDeviceAccelerationStructureCompatibilityKHR GetDeviceAccelerationStructureCompatibilityKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS } VkLayerDispatchTable; diff --git a/thirdparty/vulkan/loader/vk_loader_extensions.c b/thirdparty/vulkan/loader/vk_loader_extensions.c index 542b8b4af4..72d4027281 100644 --- a/thirdparty/vulkan/loader/vk_loader_extensions.c +++ b/thirdparty/vulkan/loader/vk_loader_extensions.c @@ -208,9 +208,6 @@ VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_t LOOKUP_GIPA(CreateViSurfaceNN, false); #endif // VK_USE_PLATFORM_VI_NN - // ---- VK_NVX_device_generated_commands extension commands - LOOKUP_GIPA(GetPhysicalDeviceGeneratedCommandsPropertiesNVX, false); - // ---- VK_EXT_direct_mode_display extension commands LOOKUP_GIPA(ReleaseDisplayEXT, false); @@ -284,6 +281,14 @@ VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_icd_term *icd_t // ---- VK_EXT_headless_surface extension commands LOOKUP_GIPA(CreateHeadlessSurfaceEXT, false); + // ---- VK_EXT_directfb_surface extension commands +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + LOOKUP_GIPA(CreateDirectFBSurfaceEXT, false); +#endif // VK_USE_PLATFORM_DIRECTFB_EXT +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + LOOKUP_GIPA(GetPhysicalDeviceDirectFBPresentationSupportEXT, false); +#endif // VK_USE_PLATFORM_DIRECTFB_EXT + #undef LOOKUP_GIPA return true; @@ -569,11 +574,36 @@ VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct lo table->GetBufferOpaqueCaptureAddressKHR = (PFN_vkGetBufferOpaqueCaptureAddressKHR)gdpa(dev, "vkGetBufferOpaqueCaptureAddressKHR"); table->GetDeviceMemoryOpaqueCaptureAddressKHR = (PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR)gdpa(dev, "vkGetDeviceMemoryOpaqueCaptureAddressKHR"); + // ---- VK_KHR_deferred_host_operations extension commands +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CreateDeferredOperationKHR = (PFN_vkCreateDeferredOperationKHR)gdpa(dev, "vkCreateDeferredOperationKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->DestroyDeferredOperationKHR = (PFN_vkDestroyDeferredOperationKHR)gdpa(dev, "vkDestroyDeferredOperationKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->GetDeferredOperationMaxConcurrencyKHR = (PFN_vkGetDeferredOperationMaxConcurrencyKHR)gdpa(dev, "vkGetDeferredOperationMaxConcurrencyKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->GetDeferredOperationResultKHR = (PFN_vkGetDeferredOperationResultKHR)gdpa(dev, "vkGetDeferredOperationResultKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->DeferredOperationJoinKHR = (PFN_vkDeferredOperationJoinKHR)gdpa(dev, "vkDeferredOperationJoinKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS + // ---- VK_KHR_pipeline_executable_properties extension commands table->GetPipelineExecutablePropertiesKHR = (PFN_vkGetPipelineExecutablePropertiesKHR)gdpa(dev, "vkGetPipelineExecutablePropertiesKHR"); table->GetPipelineExecutableStatisticsKHR = (PFN_vkGetPipelineExecutableStatisticsKHR)gdpa(dev, "vkGetPipelineExecutableStatisticsKHR"); table->GetPipelineExecutableInternalRepresentationsKHR = (PFN_vkGetPipelineExecutableInternalRepresentationsKHR)gdpa(dev, "vkGetPipelineExecutableInternalRepresentationsKHR"); + // ---- VK_KHR_copy_commands2 extension commands + table->CmdCopyBuffer2KHR = (PFN_vkCmdCopyBuffer2KHR)gdpa(dev, "vkCmdCopyBuffer2KHR"); + table->CmdCopyImage2KHR = (PFN_vkCmdCopyImage2KHR)gdpa(dev, "vkCmdCopyImage2KHR"); + table->CmdCopyBufferToImage2KHR = (PFN_vkCmdCopyBufferToImage2KHR)gdpa(dev, "vkCmdCopyBufferToImage2KHR"); + table->CmdCopyImageToBuffer2KHR = (PFN_vkCmdCopyImageToBuffer2KHR)gdpa(dev, "vkCmdCopyImageToBuffer2KHR"); + table->CmdBlitImage2KHR = (PFN_vkCmdBlitImage2KHR)gdpa(dev, "vkCmdBlitImage2KHR"); + table->CmdResolveImage2KHR = (PFN_vkCmdResolveImage2KHR)gdpa(dev, "vkCmdResolveImage2KHR"); + // ---- VK_EXT_debug_marker extension commands table->DebugMarkerSetObjectTagEXT = (PFN_vkDebugMarkerSetObjectTagEXT)gdpa(dev, "vkDebugMarkerSetObjectTagEXT"); table->DebugMarkerSetObjectNameEXT = (PFN_vkDebugMarkerSetObjectNameEXT)gdpa(dev, "vkDebugMarkerSetObjectNameEXT"); @@ -591,6 +621,7 @@ VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct lo // ---- VK_NVX_image_view_handle extension commands table->GetImageViewHandleNVX = (PFN_vkGetImageViewHandleNVX)gdpa(dev, "vkGetImageViewHandleNVX"); + table->GetImageViewAddressNVX = (PFN_vkGetImageViewAddressNVX)gdpa(dev, "vkGetImageViewAddressNVX"); // ---- VK_AMD_draw_indirect_count extension commands table->CmdDrawIndirectCountAMD = (PFN_vkCmdDrawIndirectCountAMD)gdpa(dev, "vkCmdDrawIndirectCountAMD"); @@ -608,16 +639,6 @@ VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct lo table->CmdBeginConditionalRenderingEXT = (PFN_vkCmdBeginConditionalRenderingEXT)gdpa(dev, "vkCmdBeginConditionalRenderingEXT"); table->CmdEndConditionalRenderingEXT = (PFN_vkCmdEndConditionalRenderingEXT)gdpa(dev, "vkCmdEndConditionalRenderingEXT"); - // ---- VK_NVX_device_generated_commands extension commands - table->CmdProcessCommandsNVX = (PFN_vkCmdProcessCommandsNVX)gdpa(dev, "vkCmdProcessCommandsNVX"); - table->CmdReserveSpaceForCommandsNVX = (PFN_vkCmdReserveSpaceForCommandsNVX)gdpa(dev, "vkCmdReserveSpaceForCommandsNVX"); - table->CreateIndirectCommandsLayoutNVX = (PFN_vkCreateIndirectCommandsLayoutNVX)gdpa(dev, "vkCreateIndirectCommandsLayoutNVX"); - table->DestroyIndirectCommandsLayoutNVX = (PFN_vkDestroyIndirectCommandsLayoutNVX)gdpa(dev, "vkDestroyIndirectCommandsLayoutNVX"); - table->CreateObjectTableNVX = (PFN_vkCreateObjectTableNVX)gdpa(dev, "vkCreateObjectTableNVX"); - table->DestroyObjectTableNVX = (PFN_vkDestroyObjectTableNVX)gdpa(dev, "vkDestroyObjectTableNVX"); - table->RegisterObjectsNVX = (PFN_vkRegisterObjectsNVX)gdpa(dev, "vkRegisterObjectsNVX"); - table->UnregisterObjectsNVX = (PFN_vkUnregisterObjectsNVX)gdpa(dev, "vkUnregisterObjectsNVX"); - // ---- VK_NV_clip_space_w_scaling extension commands table->CmdSetViewportWScalingNV = (PFN_vkCmdSetViewportWScalingNV)gdpa(dev, "vkCmdSetViewportWScalingNV"); @@ -674,15 +695,19 @@ VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct lo // ---- VK_NV_ray_tracing extension commands table->CreateAccelerationStructureNV = (PFN_vkCreateAccelerationStructureNV)gdpa(dev, "vkCreateAccelerationStructureNV"); + table->DestroyAccelerationStructureKHR = (PFN_vkDestroyAccelerationStructureKHR)gdpa(dev, "vkDestroyAccelerationStructureKHR"); table->DestroyAccelerationStructureNV = (PFN_vkDestroyAccelerationStructureNV)gdpa(dev, "vkDestroyAccelerationStructureNV"); table->GetAccelerationStructureMemoryRequirementsNV = (PFN_vkGetAccelerationStructureMemoryRequirementsNV)gdpa(dev, "vkGetAccelerationStructureMemoryRequirementsNV"); + table->BindAccelerationStructureMemoryKHR = (PFN_vkBindAccelerationStructureMemoryKHR)gdpa(dev, "vkBindAccelerationStructureMemoryKHR"); table->BindAccelerationStructureMemoryNV = (PFN_vkBindAccelerationStructureMemoryNV)gdpa(dev, "vkBindAccelerationStructureMemoryNV"); table->CmdBuildAccelerationStructureNV = (PFN_vkCmdBuildAccelerationStructureNV)gdpa(dev, "vkCmdBuildAccelerationStructureNV"); table->CmdCopyAccelerationStructureNV = (PFN_vkCmdCopyAccelerationStructureNV)gdpa(dev, "vkCmdCopyAccelerationStructureNV"); table->CmdTraceRaysNV = (PFN_vkCmdTraceRaysNV)gdpa(dev, "vkCmdTraceRaysNV"); table->CreateRayTracingPipelinesNV = (PFN_vkCreateRayTracingPipelinesNV)gdpa(dev, "vkCreateRayTracingPipelinesNV"); + table->GetRayTracingShaderGroupHandlesKHR = (PFN_vkGetRayTracingShaderGroupHandlesKHR)gdpa(dev, "vkGetRayTracingShaderGroupHandlesKHR"); table->GetRayTracingShaderGroupHandlesNV = (PFN_vkGetRayTracingShaderGroupHandlesNV)gdpa(dev, "vkGetRayTracingShaderGroupHandlesNV"); table->GetAccelerationStructureHandleNV = (PFN_vkGetAccelerationStructureHandleNV)gdpa(dev, "vkGetAccelerationStructureHandleNV"); + table->CmdWriteAccelerationStructuresPropertiesKHR = (PFN_vkCmdWriteAccelerationStructuresPropertiesKHR)gdpa(dev, "vkCmdWriteAccelerationStructuresPropertiesKHR"); table->CmdWriteAccelerationStructuresPropertiesNV = (PFN_vkCmdWriteAccelerationStructuresPropertiesNV)gdpa(dev, "vkCmdWriteAccelerationStructuresPropertiesNV"); table->CompileDeferredNV = (PFN_vkCompileDeferredNV)gdpa(dev, "vkCompileDeferredNV"); @@ -740,6 +765,90 @@ VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct lo // ---- VK_EXT_host_query_reset extension commands table->ResetQueryPoolEXT = (PFN_vkResetQueryPoolEXT)gdpa(dev, "vkResetQueryPoolEXT"); + + // ---- VK_EXT_extended_dynamic_state extension commands + table->CmdSetCullModeEXT = (PFN_vkCmdSetCullModeEXT)gdpa(dev, "vkCmdSetCullModeEXT"); + table->CmdSetFrontFaceEXT = (PFN_vkCmdSetFrontFaceEXT)gdpa(dev, "vkCmdSetFrontFaceEXT"); + table->CmdSetPrimitiveTopologyEXT = (PFN_vkCmdSetPrimitiveTopologyEXT)gdpa(dev, "vkCmdSetPrimitiveTopologyEXT"); + table->CmdSetViewportWithCountEXT = (PFN_vkCmdSetViewportWithCountEXT)gdpa(dev, "vkCmdSetViewportWithCountEXT"); + table->CmdSetScissorWithCountEXT = (PFN_vkCmdSetScissorWithCountEXT)gdpa(dev, "vkCmdSetScissorWithCountEXT"); + table->CmdBindVertexBuffers2EXT = (PFN_vkCmdBindVertexBuffers2EXT)gdpa(dev, "vkCmdBindVertexBuffers2EXT"); + table->CmdSetDepthTestEnableEXT = (PFN_vkCmdSetDepthTestEnableEXT)gdpa(dev, "vkCmdSetDepthTestEnableEXT"); + table->CmdSetDepthWriteEnableEXT = (PFN_vkCmdSetDepthWriteEnableEXT)gdpa(dev, "vkCmdSetDepthWriteEnableEXT"); + table->CmdSetDepthCompareOpEXT = (PFN_vkCmdSetDepthCompareOpEXT)gdpa(dev, "vkCmdSetDepthCompareOpEXT"); + table->CmdSetDepthBoundsTestEnableEXT = (PFN_vkCmdSetDepthBoundsTestEnableEXT)gdpa(dev, "vkCmdSetDepthBoundsTestEnableEXT"); + table->CmdSetStencilTestEnableEXT = (PFN_vkCmdSetStencilTestEnableEXT)gdpa(dev, "vkCmdSetStencilTestEnableEXT"); + table->CmdSetStencilOpEXT = (PFN_vkCmdSetStencilOpEXT)gdpa(dev, "vkCmdSetStencilOpEXT"); + + // ---- VK_NV_device_generated_commands extension commands + table->GetGeneratedCommandsMemoryRequirementsNV = (PFN_vkGetGeneratedCommandsMemoryRequirementsNV)gdpa(dev, "vkGetGeneratedCommandsMemoryRequirementsNV"); + table->CmdPreprocessGeneratedCommandsNV = (PFN_vkCmdPreprocessGeneratedCommandsNV)gdpa(dev, "vkCmdPreprocessGeneratedCommandsNV"); + table->CmdExecuteGeneratedCommandsNV = (PFN_vkCmdExecuteGeneratedCommandsNV)gdpa(dev, "vkCmdExecuteGeneratedCommandsNV"); + table->CmdBindPipelineShaderGroupNV = (PFN_vkCmdBindPipelineShaderGroupNV)gdpa(dev, "vkCmdBindPipelineShaderGroupNV"); + table->CreateIndirectCommandsLayoutNV = (PFN_vkCreateIndirectCommandsLayoutNV)gdpa(dev, "vkCreateIndirectCommandsLayoutNV"); + table->DestroyIndirectCommandsLayoutNV = (PFN_vkDestroyIndirectCommandsLayoutNV)gdpa(dev, "vkDestroyIndirectCommandsLayoutNV"); + + // ---- VK_EXT_private_data extension commands + table->CreatePrivateDataSlotEXT = (PFN_vkCreatePrivateDataSlotEXT)gdpa(dev, "vkCreatePrivateDataSlotEXT"); + table->DestroyPrivateDataSlotEXT = (PFN_vkDestroyPrivateDataSlotEXT)gdpa(dev, "vkDestroyPrivateDataSlotEXT"); + table->SetPrivateDataEXT = (PFN_vkSetPrivateDataEXT)gdpa(dev, "vkSetPrivateDataEXT"); + table->GetPrivateDataEXT = (PFN_vkGetPrivateDataEXT)gdpa(dev, "vkGetPrivateDataEXT"); + + // ---- VK_KHR_ray_tracing extension commands +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CreateAccelerationStructureKHR = (PFN_vkCreateAccelerationStructureKHR)gdpa(dev, "vkCreateAccelerationStructureKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->GetAccelerationStructureMemoryRequirementsKHR = (PFN_vkGetAccelerationStructureMemoryRequirementsKHR)gdpa(dev, "vkGetAccelerationStructureMemoryRequirementsKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdBuildAccelerationStructureKHR = (PFN_vkCmdBuildAccelerationStructureKHR)gdpa(dev, "vkCmdBuildAccelerationStructureKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdBuildAccelerationStructureIndirectKHR = (PFN_vkCmdBuildAccelerationStructureIndirectKHR)gdpa(dev, "vkCmdBuildAccelerationStructureIndirectKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->BuildAccelerationStructureKHR = (PFN_vkBuildAccelerationStructureKHR)gdpa(dev, "vkBuildAccelerationStructureKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CopyAccelerationStructureKHR = (PFN_vkCopyAccelerationStructureKHR)gdpa(dev, "vkCopyAccelerationStructureKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CopyAccelerationStructureToMemoryKHR = (PFN_vkCopyAccelerationStructureToMemoryKHR)gdpa(dev, "vkCopyAccelerationStructureToMemoryKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CopyMemoryToAccelerationStructureKHR = (PFN_vkCopyMemoryToAccelerationStructureKHR)gdpa(dev, "vkCopyMemoryToAccelerationStructureKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->WriteAccelerationStructuresPropertiesKHR = (PFN_vkWriteAccelerationStructuresPropertiesKHR)gdpa(dev, "vkWriteAccelerationStructuresPropertiesKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdCopyAccelerationStructureKHR = (PFN_vkCmdCopyAccelerationStructureKHR)gdpa(dev, "vkCmdCopyAccelerationStructureKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdCopyAccelerationStructureToMemoryKHR = (PFN_vkCmdCopyAccelerationStructureToMemoryKHR)gdpa(dev, "vkCmdCopyAccelerationStructureToMemoryKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdCopyMemoryToAccelerationStructureKHR = (PFN_vkCmdCopyMemoryToAccelerationStructureKHR)gdpa(dev, "vkCmdCopyMemoryToAccelerationStructureKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdTraceRaysKHR = (PFN_vkCmdTraceRaysKHR)gdpa(dev, "vkCmdTraceRaysKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CreateRayTracingPipelinesKHR = (PFN_vkCreateRayTracingPipelinesKHR)gdpa(dev, "vkCreateRayTracingPipelinesKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->GetAccelerationStructureDeviceAddressKHR = (PFN_vkGetAccelerationStructureDeviceAddressKHR)gdpa(dev, "vkGetAccelerationStructureDeviceAddressKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->GetRayTracingCaptureReplayShaderGroupHandlesKHR = (PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR)gdpa(dev, "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->CmdTraceRaysIndirectKHR = (PFN_vkCmdTraceRaysIndirectKHR)gdpa(dev, "vkCmdTraceRaysIndirectKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + table->GetDeviceAccelerationStructureCompatibilityKHR = (PFN_vkGetDeviceAccelerationStructureCompatibilityKHR)gdpa(dev, "vkGetDeviceAccelerationStructureCompatibilityKHR"); +#endif // VK_ENABLE_BETA_EXTENSIONS } // Init Instance function pointer dispatch table with core commands @@ -887,9 +996,6 @@ VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayer table->CreateViSurfaceNN = (PFN_vkCreateViSurfaceNN)gpa(inst, "vkCreateViSurfaceNN"); #endif // VK_USE_PLATFORM_VI_NN - // ---- VK_NVX_device_generated_commands extension commands - table->GetPhysicalDeviceGeneratedCommandsPropertiesNVX = (PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX)gpa(inst, "vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX"); - // ---- VK_EXT_direct_mode_display extension commands table->ReleaseDisplayEXT = (PFN_vkReleaseDisplayEXT)gpa(inst, "vkReleaseDisplayEXT"); @@ -951,6 +1057,14 @@ VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayer // ---- VK_EXT_headless_surface extension commands table->CreateHeadlessSurfaceEXT = (PFN_vkCreateHeadlessSurfaceEXT)gpa(inst, "vkCreateHeadlessSurfaceEXT"); + + // ---- VK_EXT_directfb_surface extension commands +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + table->CreateDirectFBSurfaceEXT = (PFN_vkCreateDirectFBSurfaceEXT)gpa(inst, "vkCreateDirectFBSurfaceEXT"); +#endif // VK_USE_PLATFORM_DIRECTFB_EXT +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + table->GetPhysicalDeviceDirectFBPresentationSupportEXT = (PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT)gpa(inst, "vkGetPhysicalDeviceDirectFBPresentationSupportEXT"); +#endif // VK_USE_PLATFORM_DIRECTFB_EXT } // Device command lookup function @@ -1224,11 +1338,36 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDis if (!strcmp(name, "GetBufferOpaqueCaptureAddressKHR")) return (void *)table->GetBufferOpaqueCaptureAddressKHR; if (!strcmp(name, "GetDeviceMemoryOpaqueCaptureAddressKHR")) return (void *)table->GetDeviceMemoryOpaqueCaptureAddressKHR; + // ---- VK_KHR_deferred_host_operations extension commands +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "CreateDeferredOperationKHR")) return (void *)table->CreateDeferredOperationKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "DestroyDeferredOperationKHR")) return (void *)table->DestroyDeferredOperationKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "GetDeferredOperationMaxConcurrencyKHR")) return (void *)table->GetDeferredOperationMaxConcurrencyKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "GetDeferredOperationResultKHR")) return (void *)table->GetDeferredOperationResultKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "DeferredOperationJoinKHR")) return (void *)table->DeferredOperationJoinKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS + // ---- VK_KHR_pipeline_executable_properties extension commands if (!strcmp(name, "GetPipelineExecutablePropertiesKHR")) return (void *)table->GetPipelineExecutablePropertiesKHR; if (!strcmp(name, "GetPipelineExecutableStatisticsKHR")) return (void *)table->GetPipelineExecutableStatisticsKHR; if (!strcmp(name, "GetPipelineExecutableInternalRepresentationsKHR")) return (void *)table->GetPipelineExecutableInternalRepresentationsKHR; + // ---- VK_KHR_copy_commands2 extension commands + if (!strcmp(name, "CmdCopyBuffer2KHR")) return (void *)table->CmdCopyBuffer2KHR; + if (!strcmp(name, "CmdCopyImage2KHR")) return (void *)table->CmdCopyImage2KHR; + if (!strcmp(name, "CmdCopyBufferToImage2KHR")) return (void *)table->CmdCopyBufferToImage2KHR; + if (!strcmp(name, "CmdCopyImageToBuffer2KHR")) return (void *)table->CmdCopyImageToBuffer2KHR; + if (!strcmp(name, "CmdBlitImage2KHR")) return (void *)table->CmdBlitImage2KHR; + if (!strcmp(name, "CmdResolveImage2KHR")) return (void *)table->CmdResolveImage2KHR; + // ---- VK_EXT_debug_marker extension commands if (!strcmp(name, "DebugMarkerSetObjectTagEXT")) return (void *)table->DebugMarkerSetObjectTagEXT; if (!strcmp(name, "DebugMarkerSetObjectNameEXT")) return (void *)table->DebugMarkerSetObjectNameEXT; @@ -1246,6 +1385,7 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDis // ---- VK_NVX_image_view_handle extension commands if (!strcmp(name, "GetImageViewHandleNVX")) return (void *)table->GetImageViewHandleNVX; + if (!strcmp(name, "GetImageViewAddressNVX")) return (void *)table->GetImageViewAddressNVX; // ---- VK_AMD_draw_indirect_count extension commands if (!strcmp(name, "CmdDrawIndirectCountAMD")) return (void *)table->CmdDrawIndirectCountAMD; @@ -1263,16 +1403,6 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDis if (!strcmp(name, "CmdBeginConditionalRenderingEXT")) return (void *)table->CmdBeginConditionalRenderingEXT; if (!strcmp(name, "CmdEndConditionalRenderingEXT")) return (void *)table->CmdEndConditionalRenderingEXT; - // ---- VK_NVX_device_generated_commands extension commands - if (!strcmp(name, "CmdProcessCommandsNVX")) return (void *)table->CmdProcessCommandsNVX; - if (!strcmp(name, "CmdReserveSpaceForCommandsNVX")) return (void *)table->CmdReserveSpaceForCommandsNVX; - if (!strcmp(name, "CreateIndirectCommandsLayoutNVX")) return (void *)table->CreateIndirectCommandsLayoutNVX; - if (!strcmp(name, "DestroyIndirectCommandsLayoutNVX")) return (void *)table->DestroyIndirectCommandsLayoutNVX; - if (!strcmp(name, "CreateObjectTableNVX")) return (void *)table->CreateObjectTableNVX; - if (!strcmp(name, "DestroyObjectTableNVX")) return (void *)table->DestroyObjectTableNVX; - if (!strcmp(name, "RegisterObjectsNVX")) return (void *)table->RegisterObjectsNVX; - if (!strcmp(name, "UnregisterObjectsNVX")) return (void *)table->UnregisterObjectsNVX; - // ---- VK_NV_clip_space_w_scaling extension commands if (!strcmp(name, "CmdSetViewportWScalingNV")) return (void *)table->CmdSetViewportWScalingNV; @@ -1329,15 +1459,19 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDis // ---- VK_NV_ray_tracing extension commands if (!strcmp(name, "CreateAccelerationStructureNV")) return (void *)table->CreateAccelerationStructureNV; + if (!strcmp(name, "DestroyAccelerationStructureKHR")) return (void *)table->DestroyAccelerationStructureKHR; if (!strcmp(name, "DestroyAccelerationStructureNV")) return (void *)table->DestroyAccelerationStructureNV; if (!strcmp(name, "GetAccelerationStructureMemoryRequirementsNV")) return (void *)table->GetAccelerationStructureMemoryRequirementsNV; + if (!strcmp(name, "BindAccelerationStructureMemoryKHR")) return (void *)table->BindAccelerationStructureMemoryKHR; if (!strcmp(name, "BindAccelerationStructureMemoryNV")) return (void *)table->BindAccelerationStructureMemoryNV; if (!strcmp(name, "CmdBuildAccelerationStructureNV")) return (void *)table->CmdBuildAccelerationStructureNV; if (!strcmp(name, "CmdCopyAccelerationStructureNV")) return (void *)table->CmdCopyAccelerationStructureNV; if (!strcmp(name, "CmdTraceRaysNV")) return (void *)table->CmdTraceRaysNV; if (!strcmp(name, "CreateRayTracingPipelinesNV")) return (void *)table->CreateRayTracingPipelinesNV; + if (!strcmp(name, "GetRayTracingShaderGroupHandlesKHR")) return (void *)table->GetRayTracingShaderGroupHandlesKHR; if (!strcmp(name, "GetRayTracingShaderGroupHandlesNV")) return (void *)table->GetRayTracingShaderGroupHandlesNV; if (!strcmp(name, "GetAccelerationStructureHandleNV")) return (void *)table->GetAccelerationStructureHandleNV; + if (!strcmp(name, "CmdWriteAccelerationStructuresPropertiesKHR")) return (void *)table->CmdWriteAccelerationStructuresPropertiesKHR; if (!strcmp(name, "CmdWriteAccelerationStructuresPropertiesNV")) return (void *)table->CmdWriteAccelerationStructuresPropertiesNV; if (!strcmp(name, "CompileDeferredNV")) return (void *)table->CompileDeferredNV; @@ -1396,6 +1530,90 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDis // ---- VK_EXT_host_query_reset extension commands if (!strcmp(name, "ResetQueryPoolEXT")) return (void *)table->ResetQueryPoolEXT; + // ---- VK_EXT_extended_dynamic_state extension commands + if (!strcmp(name, "CmdSetCullModeEXT")) return (void *)table->CmdSetCullModeEXT; + if (!strcmp(name, "CmdSetFrontFaceEXT")) return (void *)table->CmdSetFrontFaceEXT; + if (!strcmp(name, "CmdSetPrimitiveTopologyEXT")) return (void *)table->CmdSetPrimitiveTopologyEXT; + if (!strcmp(name, "CmdSetViewportWithCountEXT")) return (void *)table->CmdSetViewportWithCountEXT; + if (!strcmp(name, "CmdSetScissorWithCountEXT")) return (void *)table->CmdSetScissorWithCountEXT; + if (!strcmp(name, "CmdBindVertexBuffers2EXT")) return (void *)table->CmdBindVertexBuffers2EXT; + if (!strcmp(name, "CmdSetDepthTestEnableEXT")) return (void *)table->CmdSetDepthTestEnableEXT; + if (!strcmp(name, "CmdSetDepthWriteEnableEXT")) return (void *)table->CmdSetDepthWriteEnableEXT; + if (!strcmp(name, "CmdSetDepthCompareOpEXT")) return (void *)table->CmdSetDepthCompareOpEXT; + if (!strcmp(name, "CmdSetDepthBoundsTestEnableEXT")) return (void *)table->CmdSetDepthBoundsTestEnableEXT; + if (!strcmp(name, "CmdSetStencilTestEnableEXT")) return (void *)table->CmdSetStencilTestEnableEXT; + if (!strcmp(name, "CmdSetStencilOpEXT")) return (void *)table->CmdSetStencilOpEXT; + + // ---- VK_NV_device_generated_commands extension commands + if (!strcmp(name, "GetGeneratedCommandsMemoryRequirementsNV")) return (void *)table->GetGeneratedCommandsMemoryRequirementsNV; + if (!strcmp(name, "CmdPreprocessGeneratedCommandsNV")) return (void *)table->CmdPreprocessGeneratedCommandsNV; + if (!strcmp(name, "CmdExecuteGeneratedCommandsNV")) return (void *)table->CmdExecuteGeneratedCommandsNV; + if (!strcmp(name, "CmdBindPipelineShaderGroupNV")) return (void *)table->CmdBindPipelineShaderGroupNV; + if (!strcmp(name, "CreateIndirectCommandsLayoutNV")) return (void *)table->CreateIndirectCommandsLayoutNV; + if (!strcmp(name, "DestroyIndirectCommandsLayoutNV")) return (void *)table->DestroyIndirectCommandsLayoutNV; + + // ---- VK_EXT_private_data extension commands + if (!strcmp(name, "CreatePrivateDataSlotEXT")) return (void *)table->CreatePrivateDataSlotEXT; + if (!strcmp(name, "DestroyPrivateDataSlotEXT")) return (void *)table->DestroyPrivateDataSlotEXT; + if (!strcmp(name, "SetPrivateDataEXT")) return (void *)table->SetPrivateDataEXT; + if (!strcmp(name, "GetPrivateDataEXT")) return (void *)table->GetPrivateDataEXT; + + // ---- VK_KHR_ray_tracing extension commands +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "CreateAccelerationStructureKHR")) return (void *)table->CreateAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "GetAccelerationStructureMemoryRequirementsKHR")) return (void *)table->GetAccelerationStructureMemoryRequirementsKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "CmdBuildAccelerationStructureKHR")) return (void *)table->CmdBuildAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "CmdBuildAccelerationStructureIndirectKHR")) return (void *)table->CmdBuildAccelerationStructureIndirectKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "BuildAccelerationStructureKHR")) return (void *)table->BuildAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "CopyAccelerationStructureKHR")) return (void *)table->CopyAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "CopyAccelerationStructureToMemoryKHR")) return (void *)table->CopyAccelerationStructureToMemoryKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "CopyMemoryToAccelerationStructureKHR")) return (void *)table->CopyMemoryToAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "WriteAccelerationStructuresPropertiesKHR")) return (void *)table->WriteAccelerationStructuresPropertiesKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "CmdCopyAccelerationStructureKHR")) return (void *)table->CmdCopyAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "CmdCopyAccelerationStructureToMemoryKHR")) return (void *)table->CmdCopyAccelerationStructureToMemoryKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "CmdCopyMemoryToAccelerationStructureKHR")) return (void *)table->CmdCopyMemoryToAccelerationStructureKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "CmdTraceRaysKHR")) return (void *)table->CmdTraceRaysKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "CreateRayTracingPipelinesKHR")) return (void *)table->CreateRayTracingPipelinesKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "GetAccelerationStructureDeviceAddressKHR")) return (void *)table->GetAccelerationStructureDeviceAddressKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "GetRayTracingCaptureReplayShaderGroupHandlesKHR")) return (void *)table->GetRayTracingCaptureReplayShaderGroupHandlesKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "CmdTraceRaysIndirectKHR")) return (void *)table->CmdTraceRaysIndirectKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp(name, "GetDeviceAccelerationStructureCompatibilityKHR")) return (void *)table->GetDeviceAccelerationStructureCompatibilityKHR; +#endif // VK_ENABLE_BETA_EXTENSIONS + return NULL; } @@ -1546,9 +1764,6 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerI if (!strcmp(name, "CreateViSurfaceNN")) return (void *)table->CreateViSurfaceNN; #endif // VK_USE_PLATFORM_VI_NN - // ---- VK_NVX_device_generated_commands extension commands - if (!strcmp(name, "GetPhysicalDeviceGeneratedCommandsPropertiesNVX")) return (void *)table->GetPhysicalDeviceGeneratedCommandsPropertiesNVX; - // ---- VK_EXT_direct_mode_display extension commands if (!strcmp(name, "ReleaseDisplayEXT")) return (void *)table->ReleaseDisplayEXT; @@ -1611,6 +1826,14 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerI // ---- VK_EXT_headless_surface extension commands if (!strcmp(name, "CreateHeadlessSurfaceEXT")) return (void *)table->CreateHeadlessSurfaceEXT; + // ---- VK_EXT_directfb_surface extension commands +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + if (!strcmp(name, "CreateDirectFBSurfaceEXT")) return (void *)table->CreateDirectFBSurfaceEXT; +#endif // VK_USE_PLATFORM_DIRECTFB_EXT +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + if (!strcmp(name, "GetPhysicalDeviceDirectFBPresentationSupportEXT")) return (void *)table->GetPhysicalDeviceDirectFBPresentationSupportEXT; +#endif // VK_USE_PLATFORM_DIRECTFB_EXT + *found_name = false; return NULL; } @@ -2102,6 +2325,56 @@ VKAPI_ATTR uint64_t VKAPI_CALL GetDeviceMemoryOpaqueCaptureAddressKHR( } +// ---- VK_KHR_deferred_host_operations extension trampoline/terminators + +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR VkResult VKAPI_CALL CreateDeferredOperationKHR( + VkDevice device, + const VkAllocationCallbacks* pAllocator, + VkDeferredOperationKHR* pDeferredOperation) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->CreateDeferredOperationKHR(device, pAllocator, pDeferredOperation); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR void VKAPI_CALL DestroyDeferredOperationKHR( + VkDevice device, + VkDeferredOperationKHR operation, + const VkAllocationCallbacks* pAllocator) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->DestroyDeferredOperationKHR(device, operation, pAllocator); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR uint32_t VKAPI_CALL GetDeferredOperationMaxConcurrencyKHR( + VkDevice device, + VkDeferredOperationKHR operation) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetDeferredOperationMaxConcurrencyKHR(device, operation); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR VkResult VKAPI_CALL GetDeferredOperationResultKHR( + VkDevice device, + VkDeferredOperationKHR operation) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetDeferredOperationResultKHR(device, operation); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR VkResult VKAPI_CALL DeferredOperationJoinKHR( + VkDevice device, + VkDeferredOperationKHR operation) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->DeferredOperationJoinKHR(device, operation); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS + // ---- VK_KHR_pipeline_executable_properties extension trampoline/terminators VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutablePropertiesKHR( @@ -2132,6 +2405,51 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutableInternalRepresentationsKHR( } +// ---- VK_KHR_copy_commands2 extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL CmdCopyBuffer2KHR( + VkCommandBuffer commandBuffer, + const VkCopyBufferInfo2KHR* pCopyBufferInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdCopyBuffer2KHR(commandBuffer, pCopyBufferInfo); +} + +VKAPI_ATTR void VKAPI_CALL CmdCopyImage2KHR( + VkCommandBuffer commandBuffer, + const VkCopyImageInfo2KHR* pCopyImageInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdCopyImage2KHR(commandBuffer, pCopyImageInfo); +} + +VKAPI_ATTR void VKAPI_CALL CmdCopyBufferToImage2KHR( + VkCommandBuffer commandBuffer, + const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdCopyBufferToImage2KHR(commandBuffer, pCopyBufferToImageInfo); +} + +VKAPI_ATTR void VKAPI_CALL CmdCopyImageToBuffer2KHR( + VkCommandBuffer commandBuffer, + const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdCopyImageToBuffer2KHR(commandBuffer, pCopyImageToBufferInfo); +} + +VKAPI_ATTR void VKAPI_CALL CmdBlitImage2KHR( + VkCommandBuffer commandBuffer, + const VkBlitImageInfo2KHR* pBlitImageInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdBlitImage2KHR(commandBuffer, pBlitImageInfo); +} + +VKAPI_ATTR void VKAPI_CALL CmdResolveImage2KHR( + VkCommandBuffer commandBuffer, + const VkResolveImageInfo2KHR* pResolveImageInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdResolveImage2KHR(commandBuffer, pResolveImageInfo); +} + + // ---- VK_EXT_debug_marker extension trampoline/terminators VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectTagEXT( @@ -2313,6 +2631,14 @@ VKAPI_ATTR uint32_t VKAPI_CALL GetImageViewHandleNVX( return disp->GetImageViewHandleNVX(device, pInfo); } +VKAPI_ATTR VkResult VKAPI_CALL GetImageViewAddressNVX( + VkDevice device, + VkImageView imageView, + VkImageViewAddressPropertiesNVX* pProperties) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetImageViewAddressNVX(device, imageView, pProperties); +} + // ---- VK_AMD_draw_indirect_count extension trampoline/terminators @@ -2429,100 +2755,6 @@ VKAPI_ATTR void VKAPI_CALL CmdEndConditionalRenderingEXT( } -// ---- VK_NVX_device_generated_commands extension trampoline/terminators - -VKAPI_ATTR void VKAPI_CALL CmdProcessCommandsNVX( - VkCommandBuffer commandBuffer, - const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) { - const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); - disp->CmdProcessCommandsNVX(commandBuffer, pProcessCommandsInfo); -} - -VKAPI_ATTR void VKAPI_CALL CmdReserveSpaceForCommandsNVX( - VkCommandBuffer commandBuffer, - const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) { - const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); - disp->CmdReserveSpaceForCommandsNVX(commandBuffer, pReserveSpaceInfo); -} - -VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutNVX( - VkDevice device, - const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->CreateIndirectCommandsLayoutNVX(device, pCreateInfo, pAllocator, pIndirectCommandsLayout); -} - -VKAPI_ATTR void VKAPI_CALL DestroyIndirectCommandsLayoutNVX( - VkDevice device, - VkIndirectCommandsLayoutNVX indirectCommandsLayout, - const VkAllocationCallbacks* pAllocator) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - disp->DestroyIndirectCommandsLayoutNVX(device, indirectCommandsLayout, pAllocator); -} - -VKAPI_ATTR VkResult VKAPI_CALL CreateObjectTableNVX( - VkDevice device, - const VkObjectTableCreateInfoNVX* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkObjectTableNVX* pObjectTable) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->CreateObjectTableNVX(device, pCreateInfo, pAllocator, pObjectTable); -} - -VKAPI_ATTR void VKAPI_CALL DestroyObjectTableNVX( - VkDevice device, - VkObjectTableNVX objectTable, - const VkAllocationCallbacks* pAllocator) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - disp->DestroyObjectTableNVX(device, objectTable, pAllocator); -} - -VKAPI_ATTR VkResult VKAPI_CALL RegisterObjectsNVX( - VkDevice device, - VkObjectTableNVX objectTable, - uint32_t objectCount, - const VkObjectTableEntryNVX* const* ppObjectTableEntries, - const uint32_t* pObjectIndices) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->RegisterObjectsNVX(device, objectTable, objectCount, ppObjectTableEntries, pObjectIndices); -} - -VKAPI_ATTR VkResult VKAPI_CALL UnregisterObjectsNVX( - VkDevice device, - VkObjectTableNVX objectTable, - uint32_t objectCount, - const VkObjectEntryTypeNVX* pObjectEntryTypes, - const uint32_t* pObjectIndices) { - const VkLayerDispatchTable *disp = loader_get_dispatch(device); - return disp->UnregisterObjectsNVX(device, objectTable, objectCount, pObjectEntryTypes, pObjectIndices); -} - -VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceGeneratedCommandsPropertiesNVX( - VkPhysicalDevice physicalDevice, - VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, - VkDeviceGeneratedCommandsLimitsNVX* pLimits) { - const VkLayerInstanceDispatchTable *disp; - VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); - disp = loader_get_instance_layer_dispatch(physicalDevice); - disp->GetPhysicalDeviceGeneratedCommandsPropertiesNVX(unwrapped_phys_dev, pFeatures, pLimits); -} - -VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceGeneratedCommandsPropertiesNVX( - VkPhysicalDevice physicalDevice, - VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, - VkDeviceGeneratedCommandsLimitsNVX* pLimits) { - struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; - struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; - if (NULL == icd_term->dispatch.GetPhysicalDeviceGeneratedCommandsPropertiesNVX) { - loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, - "ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceGeneratedCommandsPropertiesNVX"); - } - icd_term->dispatch.GetPhysicalDeviceGeneratedCommandsPropertiesNVX(phys_dev_term->phys_dev, pFeatures, pLimits); -} - - // ---- VK_NV_clip_space_w_scaling extension trampoline/terminators VKAPI_ATTR void VKAPI_CALL CmdSetViewportWScalingNV( @@ -2974,9 +3206,17 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateAccelerationStructureNV( return disp->CreateAccelerationStructureNV(device, pCreateInfo, pAllocator, pAccelerationStructure); } +VKAPI_ATTR void VKAPI_CALL DestroyAccelerationStructureKHR( + VkDevice device, + VkAccelerationStructureKHR accelerationStructure, + const VkAllocationCallbacks* pAllocator) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->DestroyAccelerationStructureKHR(device, accelerationStructure, pAllocator); +} + VKAPI_ATTR void VKAPI_CALL DestroyAccelerationStructureNV( VkDevice device, - VkAccelerationStructureNV accelerationStructure, + VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks* pAllocator) { const VkLayerDispatchTable *disp = loader_get_dispatch(device); disp->DestroyAccelerationStructureNV(device, accelerationStructure, pAllocator); @@ -2990,10 +3230,18 @@ VKAPI_ATTR void VKAPI_CALL GetAccelerationStructureMemoryRequirementsNV( disp->GetAccelerationStructureMemoryRequirementsNV(device, pInfo, pMemoryRequirements); } +VKAPI_ATTR VkResult VKAPI_CALL BindAccelerationStructureMemoryKHR( + VkDevice device, + uint32_t bindInfoCount, + const VkBindAccelerationStructureMemoryInfoKHR* pBindInfos) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->BindAccelerationStructureMemoryKHR(device, bindInfoCount, pBindInfos); +} + VKAPI_ATTR VkResult VKAPI_CALL BindAccelerationStructureMemoryNV( VkDevice device, uint32_t bindInfoCount, - const VkBindAccelerationStructureMemoryInfoNV* pBindInfos) { + const VkBindAccelerationStructureMemoryInfoKHR* pBindInfos) { const VkLayerDispatchTable *disp = loader_get_dispatch(device); return disp->BindAccelerationStructureMemoryNV(device, bindInfoCount, pBindInfos); } @@ -3004,8 +3252,8 @@ VKAPI_ATTR void VKAPI_CALL CmdBuildAccelerationStructureNV( VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, - VkAccelerationStructureNV dst, - VkAccelerationStructureNV src, + VkAccelerationStructureKHR dst, + VkAccelerationStructureKHR src, VkBuffer scratch, VkDeviceSize scratchOffset) { const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); @@ -3014,9 +3262,9 @@ VKAPI_ATTR void VKAPI_CALL CmdBuildAccelerationStructureNV( VKAPI_ATTR void VKAPI_CALL CmdCopyAccelerationStructureNV( VkCommandBuffer commandBuffer, - VkAccelerationStructureNV dst, - VkAccelerationStructureNV src, - VkCopyAccelerationStructureModeNV mode) { + VkAccelerationStructureKHR dst, + VkAccelerationStructureKHR src, + VkCopyAccelerationStructureModeKHR mode) { const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); disp->CmdCopyAccelerationStructureNV(commandBuffer, dst, src, mode); } @@ -3052,6 +3300,17 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateRayTracingPipelinesNV( return disp->CreateRayTracingPipelinesNV(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); } +VKAPI_ATTR VkResult VKAPI_CALL GetRayTracingShaderGroupHandlesKHR( + VkDevice device, + VkPipeline pipeline, + uint32_t firstGroup, + uint32_t groupCount, + size_t dataSize, + void* pData) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetRayTracingShaderGroupHandlesKHR(device, pipeline, firstGroup, groupCount, dataSize, pData); +} + VKAPI_ATTR VkResult VKAPI_CALL GetRayTracingShaderGroupHandlesNV( VkDevice device, VkPipeline pipeline, @@ -3065,17 +3324,28 @@ VKAPI_ATTR VkResult VKAPI_CALL GetRayTracingShaderGroupHandlesNV( VKAPI_ATTR VkResult VKAPI_CALL GetAccelerationStructureHandleNV( VkDevice device, - VkAccelerationStructureNV accelerationStructure, + VkAccelerationStructureKHR accelerationStructure, size_t dataSize, void* pData) { const VkLayerDispatchTable *disp = loader_get_dispatch(device); return disp->GetAccelerationStructureHandleNV(device, accelerationStructure, dataSize, pData); } +VKAPI_ATTR void VKAPI_CALL CmdWriteAccelerationStructuresPropertiesKHR( + VkCommandBuffer commandBuffer, + uint32_t accelerationStructureCount, + const VkAccelerationStructureKHR* pAccelerationStructures, + VkQueryType queryType, + VkQueryPool queryPool, + uint32_t firstQuery) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdWriteAccelerationStructuresPropertiesKHR(commandBuffer, accelerationStructureCount, pAccelerationStructures, queryType, queryPool, firstQuery); +} + VKAPI_ATTR void VKAPI_CALL CmdWriteAccelerationStructuresPropertiesNV( VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, - const VkAccelerationStructureNV* pAccelerationStructures, + const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) { @@ -3421,6 +3691,395 @@ VKAPI_ATTR void VKAPI_CALL ResetQueryPoolEXT( disp->ResetQueryPoolEXT(device, queryPool, firstQuery, queryCount); } + +// ---- VK_EXT_extended_dynamic_state extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL CmdSetCullModeEXT( + VkCommandBuffer commandBuffer, + VkCullModeFlags cullMode) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetCullModeEXT(commandBuffer, cullMode); +} + +VKAPI_ATTR void VKAPI_CALL CmdSetFrontFaceEXT( + VkCommandBuffer commandBuffer, + VkFrontFace frontFace) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetFrontFaceEXT(commandBuffer, frontFace); +} + +VKAPI_ATTR void VKAPI_CALL CmdSetPrimitiveTopologyEXT( + VkCommandBuffer commandBuffer, + VkPrimitiveTopology primitiveTopology) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetPrimitiveTopologyEXT(commandBuffer, primitiveTopology); +} + +VKAPI_ATTR void VKAPI_CALL CmdSetViewportWithCountEXT( + VkCommandBuffer commandBuffer, + uint32_t viewportCount, + const VkViewport* pViewports) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetViewportWithCountEXT(commandBuffer, viewportCount, pViewports); +} + +VKAPI_ATTR void VKAPI_CALL CmdSetScissorWithCountEXT( + VkCommandBuffer commandBuffer, + uint32_t scissorCount, + const VkRect2D* pScissors) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetScissorWithCountEXT(commandBuffer, scissorCount, pScissors); +} + +VKAPI_ATTR void VKAPI_CALL CmdBindVertexBuffers2EXT( + VkCommandBuffer commandBuffer, + uint32_t firstBinding, + uint32_t bindingCount, + const VkBuffer* pBuffers, + const VkDeviceSize* pOffsets, + const VkDeviceSize* pSizes, + const VkDeviceSize* pStrides) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdBindVertexBuffers2EXT(commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes, pStrides); +} + +VKAPI_ATTR void VKAPI_CALL CmdSetDepthTestEnableEXT( + VkCommandBuffer commandBuffer, + VkBool32 depthTestEnable) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetDepthTestEnableEXT(commandBuffer, depthTestEnable); +} + +VKAPI_ATTR void VKAPI_CALL CmdSetDepthWriteEnableEXT( + VkCommandBuffer commandBuffer, + VkBool32 depthWriteEnable) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetDepthWriteEnableEXT(commandBuffer, depthWriteEnable); +} + +VKAPI_ATTR void VKAPI_CALL CmdSetDepthCompareOpEXT( + VkCommandBuffer commandBuffer, + VkCompareOp depthCompareOp) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetDepthCompareOpEXT(commandBuffer, depthCompareOp); +} + +VKAPI_ATTR void VKAPI_CALL CmdSetDepthBoundsTestEnableEXT( + VkCommandBuffer commandBuffer, + VkBool32 depthBoundsTestEnable) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetDepthBoundsTestEnableEXT(commandBuffer, depthBoundsTestEnable); +} + +VKAPI_ATTR void VKAPI_CALL CmdSetStencilTestEnableEXT( + VkCommandBuffer commandBuffer, + VkBool32 stencilTestEnable) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetStencilTestEnableEXT(commandBuffer, stencilTestEnable); +} + +VKAPI_ATTR void VKAPI_CALL CmdSetStencilOpEXT( + VkCommandBuffer commandBuffer, + VkStencilFaceFlags faceMask, + VkStencilOp failOp, + VkStencilOp passOp, + VkStencilOp depthFailOp, + VkCompareOp compareOp) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdSetStencilOpEXT(commandBuffer, faceMask, failOp, passOp, depthFailOp, compareOp); +} + + +// ---- VK_NV_device_generated_commands extension trampoline/terminators + +VKAPI_ATTR void VKAPI_CALL GetGeneratedCommandsMemoryRequirementsNV( + VkDevice device, + const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo, + VkMemoryRequirements2* pMemoryRequirements) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->GetGeneratedCommandsMemoryRequirementsNV(device, pInfo, pMemoryRequirements); +} + +VKAPI_ATTR void VKAPI_CALL CmdPreprocessGeneratedCommandsNV( + VkCommandBuffer commandBuffer, + const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdPreprocessGeneratedCommandsNV(commandBuffer, pGeneratedCommandsInfo); +} + +VKAPI_ATTR void VKAPI_CALL CmdExecuteGeneratedCommandsNV( + VkCommandBuffer commandBuffer, + VkBool32 isPreprocessed, + const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdExecuteGeneratedCommandsNV(commandBuffer, isPreprocessed, pGeneratedCommandsInfo); +} + +VKAPI_ATTR void VKAPI_CALL CmdBindPipelineShaderGroupNV( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipeline pipeline, + uint32_t groupIndex) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdBindPipelineShaderGroupNV(commandBuffer, pipelineBindPoint, pipeline, groupIndex); +} + +VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutNV( + VkDevice device, + const VkIndirectCommandsLayoutCreateInfoNV* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkIndirectCommandsLayoutNV* pIndirectCommandsLayout) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->CreateIndirectCommandsLayoutNV(device, pCreateInfo, pAllocator, pIndirectCommandsLayout); +} + +VKAPI_ATTR void VKAPI_CALL DestroyIndirectCommandsLayoutNV( + VkDevice device, + VkIndirectCommandsLayoutNV indirectCommandsLayout, + const VkAllocationCallbacks* pAllocator) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->DestroyIndirectCommandsLayoutNV(device, indirectCommandsLayout, pAllocator); +} + + +// ---- VK_EXT_private_data extension trampoline/terminators + +VKAPI_ATTR VkResult VKAPI_CALL CreatePrivateDataSlotEXT( + VkDevice device, + const VkPrivateDataSlotCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkPrivateDataSlotEXT* pPrivateDataSlot) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->CreatePrivateDataSlotEXT(device, pCreateInfo, pAllocator, pPrivateDataSlot); +} + +VKAPI_ATTR void VKAPI_CALL DestroyPrivateDataSlotEXT( + VkDevice device, + VkPrivateDataSlotEXT privateDataSlot, + const VkAllocationCallbacks* pAllocator) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->DestroyPrivateDataSlotEXT(device, privateDataSlot, pAllocator); +} + +VKAPI_ATTR VkResult VKAPI_CALL SetPrivateDataEXT( + VkDevice device, + VkObjectType objectType, + uint64_t objectHandle, + VkPrivateDataSlotEXT privateDataSlot, + uint64_t data) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->SetPrivateDataEXT(device, objectType, objectHandle, privateDataSlot, data); +} + +VKAPI_ATTR void VKAPI_CALL GetPrivateDataEXT( + VkDevice device, + VkObjectType objectType, + uint64_t objectHandle, + VkPrivateDataSlotEXT privateDataSlot, + uint64_t* pData) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->GetPrivateDataEXT(device, objectType, objectHandle, privateDataSlot, pData); +} + + +// ---- VK_KHR_ray_tracing extension trampoline/terminators + +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR VkResult VKAPI_CALL CreateAccelerationStructureKHR( + VkDevice device, + const VkAccelerationStructureCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkAccelerationStructureKHR* pAccelerationStructure) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->CreateAccelerationStructureKHR(device, pCreateInfo, pAllocator, pAccelerationStructure); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR void VKAPI_CALL GetAccelerationStructureMemoryRequirementsKHR( + VkDevice device, + const VkAccelerationStructureMemoryRequirementsInfoKHR* pInfo, + VkMemoryRequirements2* pMemoryRequirements) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + disp->GetAccelerationStructureMemoryRequirementsKHR(device, pInfo, pMemoryRequirements); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR void VKAPI_CALL CmdBuildAccelerationStructureKHR( + VkCommandBuffer commandBuffer, + uint32_t infoCount, + const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, + const VkAccelerationStructureBuildOffsetInfoKHR* const* ppOffsetInfos) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdBuildAccelerationStructureKHR(commandBuffer, infoCount, pInfos, ppOffsetInfos); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR void VKAPI_CALL CmdBuildAccelerationStructureIndirectKHR( + VkCommandBuffer commandBuffer, + const VkAccelerationStructureBuildGeometryInfoKHR* pInfo, + VkBuffer indirectBuffer, + VkDeviceSize indirectOffset, + uint32_t indirectStride) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdBuildAccelerationStructureIndirectKHR(commandBuffer, pInfo, indirectBuffer, indirectOffset, indirectStride); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR VkResult VKAPI_CALL BuildAccelerationStructureKHR( + VkDevice device, + uint32_t infoCount, + const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, + const VkAccelerationStructureBuildOffsetInfoKHR* const* ppOffsetInfos) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->BuildAccelerationStructureKHR(device, infoCount, pInfos, ppOffsetInfos); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR VkResult VKAPI_CALL CopyAccelerationStructureKHR( + VkDevice device, + const VkCopyAccelerationStructureInfoKHR* pInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->CopyAccelerationStructureKHR(device, pInfo); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR VkResult VKAPI_CALL CopyAccelerationStructureToMemoryKHR( + VkDevice device, + const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->CopyAccelerationStructureToMemoryKHR(device, pInfo); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR VkResult VKAPI_CALL CopyMemoryToAccelerationStructureKHR( + VkDevice device, + const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->CopyMemoryToAccelerationStructureKHR(device, pInfo); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR VkResult VKAPI_CALL WriteAccelerationStructuresPropertiesKHR( + VkDevice device, + uint32_t accelerationStructureCount, + const VkAccelerationStructureKHR* pAccelerationStructures, + VkQueryType queryType, + size_t dataSize, + void* pData, + size_t stride) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->WriteAccelerationStructuresPropertiesKHR(device, accelerationStructureCount, pAccelerationStructures, queryType, dataSize, pData, stride); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR void VKAPI_CALL CmdCopyAccelerationStructureKHR( + VkCommandBuffer commandBuffer, + const VkCopyAccelerationStructureInfoKHR* pInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdCopyAccelerationStructureKHR(commandBuffer, pInfo); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR void VKAPI_CALL CmdCopyAccelerationStructureToMemoryKHR( + VkCommandBuffer commandBuffer, + const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdCopyAccelerationStructureToMemoryKHR(commandBuffer, pInfo); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR void VKAPI_CALL CmdCopyMemoryToAccelerationStructureKHR( + VkCommandBuffer commandBuffer, + const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdCopyMemoryToAccelerationStructureKHR(commandBuffer, pInfo); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR void VKAPI_CALL CmdTraceRaysKHR( + VkCommandBuffer commandBuffer, + const VkStridedBufferRegionKHR* pRaygenShaderBindingTable, + const VkStridedBufferRegionKHR* pMissShaderBindingTable, + const VkStridedBufferRegionKHR* pHitShaderBindingTable, + const VkStridedBufferRegionKHR* pCallableShaderBindingTable, + uint32_t width, + uint32_t height, + uint32_t depth) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdTraceRaysKHR(commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable, pHitShaderBindingTable, pCallableShaderBindingTable, width, height, depth); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR VkResult VKAPI_CALL CreateRayTracingPipelinesKHR( + VkDevice device, + VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkPipeline* pPipelines) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->CreateRayTracingPipelinesKHR(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetAccelerationStructureDeviceAddressKHR( + VkDevice device, + const VkAccelerationStructureDeviceAddressInfoKHR* pInfo) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetAccelerationStructureDeviceAddressKHR(device, pInfo); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR VkResult VKAPI_CALL GetRayTracingCaptureReplayShaderGroupHandlesKHR( + VkDevice device, + VkPipeline pipeline, + uint32_t firstGroup, + uint32_t groupCount, + size_t dataSize, + void* pData) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetRayTracingCaptureReplayShaderGroupHandlesKHR(device, pipeline, firstGroup, groupCount, dataSize, pData); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR void VKAPI_CALL CmdTraceRaysIndirectKHR( + VkCommandBuffer commandBuffer, + const VkStridedBufferRegionKHR* pRaygenShaderBindingTable, + const VkStridedBufferRegionKHR* pMissShaderBindingTable, + const VkStridedBufferRegionKHR* pHitShaderBindingTable, + const VkStridedBufferRegionKHR* pCallableShaderBindingTable, + VkBuffer buffer, + VkDeviceSize offset) { + const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer); + disp->CmdTraceRaysIndirectKHR(commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable, pHitShaderBindingTable, pCallableShaderBindingTable, buffer, offset); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS +VKAPI_ATTR VkResult VKAPI_CALL GetDeviceAccelerationStructureCompatibilityKHR( + VkDevice device, + const VkAccelerationStructureVersionKHR* version) { + const VkLayerDispatchTable *disp = loader_get_dispatch(device); + return disp->GetDeviceAccelerationStructureCompatibilityKHR(device, version); +} + +#endif // VK_ENABLE_BETA_EXTENSIONS // GPA helpers for extensions bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr) { *addr = NULL; @@ -3660,20 +4319,6 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na return true; } - // ---- VK_KHR_get_surface_capabilities2 extension commands - if (!strcmp("vkGetPhysicalDeviceSurfaceCapabilities2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions.khr_get_surface_capabilities2 == 1) - ? (void *)GetPhysicalDeviceSurfaceCapabilities2KHR - : NULL; - return true; - } - if (!strcmp("vkGetPhysicalDeviceSurfaceFormats2KHR", name)) { - *addr = (ptr_instance->enabled_known_extensions.khr_get_surface_capabilities2 == 1) - ? (void *)GetPhysicalDeviceSurfaceFormats2KHR - : NULL; - return true; - } - // ---- VK_KHR_get_memory_requirements2 extension commands if (!strcmp("vkGetImageMemoryRequirements2KHR", name)) { *addr = (void *)GetImageMemoryRequirements2KHR; @@ -3752,6 +4397,38 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na return true; } + // ---- VK_KHR_deferred_host_operations extension commands +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkCreateDeferredOperationKHR", name)) { + *addr = (void *)CreateDeferredOperationKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkDestroyDeferredOperationKHR", name)) { + *addr = (void *)DestroyDeferredOperationKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkGetDeferredOperationMaxConcurrencyKHR", name)) { + *addr = (void *)GetDeferredOperationMaxConcurrencyKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkGetDeferredOperationResultKHR", name)) { + *addr = (void *)GetDeferredOperationResultKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkDeferredOperationJoinKHR", name)) { + *addr = (void *)DeferredOperationJoinKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS + // ---- VK_KHR_pipeline_executable_properties extension commands if (!strcmp("vkGetPipelineExecutablePropertiesKHR", name)) { *addr = (void *)GetPipelineExecutablePropertiesKHR; @@ -3766,6 +4443,32 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na return true; } + // ---- VK_KHR_copy_commands2 extension commands + if (!strcmp("vkCmdCopyBuffer2KHR", name)) { + *addr = (void *)CmdCopyBuffer2KHR; + return true; + } + if (!strcmp("vkCmdCopyImage2KHR", name)) { + *addr = (void *)CmdCopyImage2KHR; + return true; + } + if (!strcmp("vkCmdCopyBufferToImage2KHR", name)) { + *addr = (void *)CmdCopyBufferToImage2KHR; + return true; + } + if (!strcmp("vkCmdCopyImageToBuffer2KHR", name)) { + *addr = (void *)CmdCopyImageToBuffer2KHR; + return true; + } + if (!strcmp("vkCmdBlitImage2KHR", name)) { + *addr = (void *)CmdBlitImage2KHR; + return true; + } + if (!strcmp("vkCmdResolveImage2KHR", name)) { + *addr = (void *)CmdResolveImage2KHR; + return true; + } + // ---- VK_EXT_debug_marker extension commands if (!strcmp("vkDebugMarkerSetObjectTagEXT", name)) { *addr = (void *)DebugMarkerSetObjectTagEXT; @@ -3819,6 +4522,10 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na *addr = (void *)GetImageViewHandleNVX; return true; } + if (!strcmp("vkGetImageViewAddressNVX", name)) { + *addr = (void *)GetImageViewAddressNVX; + return true; + } // ---- VK_AMD_draw_indirect_count extension commands if (!strcmp("vkCmdDrawIndirectCountAMD", name)) { @@ -3882,44 +4589,6 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na return true; } - // ---- VK_NVX_device_generated_commands extension commands - if (!strcmp("vkCmdProcessCommandsNVX", name)) { - *addr = (void *)CmdProcessCommandsNVX; - return true; - } - if (!strcmp("vkCmdReserveSpaceForCommandsNVX", name)) { - *addr = (void *)CmdReserveSpaceForCommandsNVX; - return true; - } - if (!strcmp("vkCreateIndirectCommandsLayoutNVX", name)) { - *addr = (void *)CreateIndirectCommandsLayoutNVX; - return true; - } - if (!strcmp("vkDestroyIndirectCommandsLayoutNVX", name)) { - *addr = (void *)DestroyIndirectCommandsLayoutNVX; - return true; - } - if (!strcmp("vkCreateObjectTableNVX", name)) { - *addr = (void *)CreateObjectTableNVX; - return true; - } - if (!strcmp("vkDestroyObjectTableNVX", name)) { - *addr = (void *)DestroyObjectTableNVX; - return true; - } - if (!strcmp("vkRegisterObjectsNVX", name)) { - *addr = (void *)RegisterObjectsNVX; - return true; - } - if (!strcmp("vkUnregisterObjectsNVX", name)) { - *addr = (void *)UnregisterObjectsNVX; - return true; - } - if (!strcmp("vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX", name)) { - *addr = (void *)GetPhysicalDeviceGeneratedCommandsPropertiesNVX; - return true; - } - // ---- VK_NV_clip_space_w_scaling extension commands if (!strcmp("vkCmdSetViewportWScalingNV", name)) { *addr = (void *)CmdSetViewportWScalingNV; @@ -4117,6 +4786,10 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na *addr = (void *)CreateAccelerationStructureNV; return true; } + if (!strcmp("vkDestroyAccelerationStructureKHR", name)) { + *addr = (void *)DestroyAccelerationStructureKHR; + return true; + } if (!strcmp("vkDestroyAccelerationStructureNV", name)) { *addr = (void *)DestroyAccelerationStructureNV; return true; @@ -4125,6 +4798,10 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na *addr = (void *)GetAccelerationStructureMemoryRequirementsNV; return true; } + if (!strcmp("vkBindAccelerationStructureMemoryKHR", name)) { + *addr = (void *)BindAccelerationStructureMemoryKHR; + return true; + } if (!strcmp("vkBindAccelerationStructureMemoryNV", name)) { *addr = (void *)BindAccelerationStructureMemoryNV; return true; @@ -4145,6 +4822,10 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na *addr = (void *)CreateRayTracingPipelinesNV; return true; } + if (!strcmp("vkGetRayTracingShaderGroupHandlesKHR", name)) { + *addr = (void *)GetRayTracingShaderGroupHandlesKHR; + return true; + } if (!strcmp("vkGetRayTracingShaderGroupHandlesNV", name)) { *addr = (void *)GetRayTracingShaderGroupHandlesNV; return true; @@ -4153,6 +4834,10 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na *addr = (void *)GetAccelerationStructureHandleNV; return true; } + if (!strcmp("vkCmdWriteAccelerationStructuresPropertiesKHR", name)) { + *addr = (void *)CmdWriteAccelerationStructuresPropertiesKHR; + return true; + } if (!strcmp("vkCmdWriteAccelerationStructuresPropertiesNV", name)) { *addr = (void *)CmdWriteAccelerationStructuresPropertiesNV; return true; @@ -4329,6 +5014,210 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na *addr = (void *)ResetQueryPoolEXT; return true; } + + // ---- VK_EXT_extended_dynamic_state extension commands + if (!strcmp("vkCmdSetCullModeEXT", name)) { + *addr = (void *)CmdSetCullModeEXT; + return true; + } + if (!strcmp("vkCmdSetFrontFaceEXT", name)) { + *addr = (void *)CmdSetFrontFaceEXT; + return true; + } + if (!strcmp("vkCmdSetPrimitiveTopologyEXT", name)) { + *addr = (void *)CmdSetPrimitiveTopologyEXT; + return true; + } + if (!strcmp("vkCmdSetViewportWithCountEXT", name)) { + *addr = (void *)CmdSetViewportWithCountEXT; + return true; + } + if (!strcmp("vkCmdSetScissorWithCountEXT", name)) { + *addr = (void *)CmdSetScissorWithCountEXT; + return true; + } + if (!strcmp("vkCmdBindVertexBuffers2EXT", name)) { + *addr = (void *)CmdBindVertexBuffers2EXT; + return true; + } + if (!strcmp("vkCmdSetDepthTestEnableEXT", name)) { + *addr = (void *)CmdSetDepthTestEnableEXT; + return true; + } + if (!strcmp("vkCmdSetDepthWriteEnableEXT", name)) { + *addr = (void *)CmdSetDepthWriteEnableEXT; + return true; + } + if (!strcmp("vkCmdSetDepthCompareOpEXT", name)) { + *addr = (void *)CmdSetDepthCompareOpEXT; + return true; + } + if (!strcmp("vkCmdSetDepthBoundsTestEnableEXT", name)) { + *addr = (void *)CmdSetDepthBoundsTestEnableEXT; + return true; + } + if (!strcmp("vkCmdSetStencilTestEnableEXT", name)) { + *addr = (void *)CmdSetStencilTestEnableEXT; + return true; + } + if (!strcmp("vkCmdSetStencilOpEXT", name)) { + *addr = (void *)CmdSetStencilOpEXT; + return true; + } + + // ---- VK_NV_device_generated_commands extension commands + if (!strcmp("vkGetGeneratedCommandsMemoryRequirementsNV", name)) { + *addr = (void *)GetGeneratedCommandsMemoryRequirementsNV; + return true; + } + if (!strcmp("vkCmdPreprocessGeneratedCommandsNV", name)) { + *addr = (void *)CmdPreprocessGeneratedCommandsNV; + return true; + } + if (!strcmp("vkCmdExecuteGeneratedCommandsNV", name)) { + *addr = (void *)CmdExecuteGeneratedCommandsNV; + return true; + } + if (!strcmp("vkCmdBindPipelineShaderGroupNV", name)) { + *addr = (void *)CmdBindPipelineShaderGroupNV; + return true; + } + if (!strcmp("vkCreateIndirectCommandsLayoutNV", name)) { + *addr = (void *)CreateIndirectCommandsLayoutNV; + return true; + } + if (!strcmp("vkDestroyIndirectCommandsLayoutNV", name)) { + *addr = (void *)DestroyIndirectCommandsLayoutNV; + return true; + } + + // ---- VK_EXT_private_data extension commands + if (!strcmp("vkCreatePrivateDataSlotEXT", name)) { + *addr = (void *)CreatePrivateDataSlotEXT; + return true; + } + if (!strcmp("vkDestroyPrivateDataSlotEXT", name)) { + *addr = (void *)DestroyPrivateDataSlotEXT; + return true; + } + if (!strcmp("vkSetPrivateDataEXT", name)) { + *addr = (void *)SetPrivateDataEXT; + return true; + } + if (!strcmp("vkGetPrivateDataEXT", name)) { + *addr = (void *)GetPrivateDataEXT; + return true; + } + + // ---- VK_KHR_ray_tracing extension commands +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkCreateAccelerationStructureKHR", name)) { + *addr = (void *)CreateAccelerationStructureKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkGetAccelerationStructureMemoryRequirementsKHR", name)) { + *addr = (void *)GetAccelerationStructureMemoryRequirementsKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkCmdBuildAccelerationStructureKHR", name)) { + *addr = (void *)CmdBuildAccelerationStructureKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkCmdBuildAccelerationStructureIndirectKHR", name)) { + *addr = (void *)CmdBuildAccelerationStructureIndirectKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkBuildAccelerationStructureKHR", name)) { + *addr = (void *)BuildAccelerationStructureKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkCopyAccelerationStructureKHR", name)) { + *addr = (void *)CopyAccelerationStructureKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkCopyAccelerationStructureToMemoryKHR", name)) { + *addr = (void *)CopyAccelerationStructureToMemoryKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkCopyMemoryToAccelerationStructureKHR", name)) { + *addr = (void *)CopyMemoryToAccelerationStructureKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkWriteAccelerationStructuresPropertiesKHR", name)) { + *addr = (void *)WriteAccelerationStructuresPropertiesKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkCmdCopyAccelerationStructureKHR", name)) { + *addr = (void *)CmdCopyAccelerationStructureKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkCmdCopyAccelerationStructureToMemoryKHR", name)) { + *addr = (void *)CmdCopyAccelerationStructureToMemoryKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkCmdCopyMemoryToAccelerationStructureKHR", name)) { + *addr = (void *)CmdCopyMemoryToAccelerationStructureKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkCmdTraceRaysKHR", name)) { + *addr = (void *)CmdTraceRaysKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkCreateRayTracingPipelinesKHR", name)) { + *addr = (void *)CreateRayTracingPipelinesKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkGetAccelerationStructureDeviceAddressKHR", name)) { + *addr = (void *)GetAccelerationStructureDeviceAddressKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkGetRayTracingCaptureReplayShaderGroupHandlesKHR", name)) { + *addr = (void *)GetRayTracingCaptureReplayShaderGroupHandlesKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkCmdTraceRaysIndirectKHR", name)) { + *addr = (void *)CmdTraceRaysIndirectKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS +#ifdef VK_ENABLE_BETA_EXTENSIONS + if (!strcmp("vkGetDeviceAccelerationStructureCompatibilityKHR", name)) { + *addr = (void *)GetDeviceAccelerationStructureCompatibilityKHR; + return true; + } +#endif // VK_ENABLE_BETA_EXTENSIONS return false; } @@ -4356,10 +5245,6 @@ void extensions_create_instance(struct loader_instance *ptr_instance, const VkIn } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME)) { ptr_instance->enabled_known_extensions.khr_external_fence_capabilities = 1; - // ---- VK_KHR_get_surface_capabilities2 extension commands - } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME)) { - ptr_instance->enabled_known_extensions.khr_get_surface_capabilities2 = 1; - // ---- VK_GGP_stream_descriptor_surface extension commands #ifdef VK_USE_PLATFORM_GGP } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME)) { @@ -4462,7 +5347,7 @@ PFN_vkVoidFunction get_extension_device_proc_terminator(struct loader_device *de addr = (PFN_vkVoidFunction)terminator_GetDeviceGroupSurfacePresentModes2EXT; } } -#endif // None +#endif // VK_ENABLE_BETA_EXTENSIONS return addr; } @@ -4607,9 +5492,6 @@ const VkLayerInstanceDispatchTable instance_disp = { .CreateViSurfaceNN = terminator_CreateViSurfaceNN, #endif // VK_USE_PLATFORM_VI_NN - // ---- VK_NVX_device_generated_commands extension commands - .GetPhysicalDeviceGeneratedCommandsPropertiesNVX = terminator_GetPhysicalDeviceGeneratedCommandsPropertiesNVX, - // ---- VK_EXT_direct_mode_display extension commands .ReleaseDisplayEXT = terminator_ReleaseDisplayEXT, @@ -4671,6 +5553,14 @@ const VkLayerInstanceDispatchTable instance_disp = { // ---- VK_EXT_headless_surface extension commands .CreateHeadlessSurfaceEXT = terminator_CreateHeadlessSurfaceEXT, + + // ---- VK_EXT_directfb_surface extension commands +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + .CreateDirectFBSurfaceEXT = terminator_CreateDirectFBSurfaceEXT, +#endif // VK_USE_PLATFORM_DIRECTFB_EXT +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + .GetPhysicalDeviceDirectFBPresentationSupportEXT = terminator_GetPhysicalDeviceDirectFBPresentationSupportEXT, +#endif // VK_USE_PLATFORM_DIRECTFB_EXT }; // A null-terminated list of all of the instance extensions supported by the loader. @@ -4730,5 +5620,8 @@ const char *const LOADER_INSTANCE_EXTENSIONS[] = { #endif // VK_USE_PLATFORM_METAL_EXT VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME, VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME, +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME, +#endif // VK_USE_PLATFORM_DIRECTFB_EXT NULL }; diff --git a/thirdparty/vulkan/loader/vk_loader_extensions.h b/thirdparty/vulkan/loader/vk_loader_extensions.h index a50f3cdd32..9835e16a07 100644 --- a/thirdparty/vulkan/loader/vk_loader_extensions.h +++ b/thirdparty/vulkan/loader/vk_loader_extensions.h @@ -356,9 +356,6 @@ struct loader_icd_term_dispatch { PFN_vkCreateViSurfaceNN CreateViSurfaceNN; #endif // VK_USE_PLATFORM_VI_NN - // ---- VK_NVX_device_generated_commands extension commands - PFN_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX GetPhysicalDeviceGeneratedCommandsPropertiesNVX; - // ---- VK_EXT_direct_mode_display extension commands PFN_vkReleaseDisplayEXT ReleaseDisplayEXT; @@ -431,6 +428,14 @@ struct loader_icd_term_dispatch { // ---- VK_EXT_headless_surface extension commands PFN_vkCreateHeadlessSurfaceEXT CreateHeadlessSurfaceEXT; + + // ---- VK_EXT_directfb_surface extension commands +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + PFN_vkCreateDirectFBSurfaceEXT CreateDirectFBSurfaceEXT; +#endif // VK_USE_PLATFORM_DIRECTFB_EXT +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT GetPhysicalDeviceDirectFBPresentationSupportEXT; +#endif // VK_USE_PLATFORM_DIRECTFB_EXT }; union loader_instance_extension_enables { @@ -440,7 +445,6 @@ union loader_instance_extension_enables { uint8_t khr_external_memory_capabilities : 1; uint8_t khr_external_semaphore_capabilities : 1; uint8_t khr_external_fence_capabilities : 1; - uint8_t khr_get_surface_capabilities2 : 1; uint8_t ext_debug_report : 1; uint8_t ggp_stream_descriptor_surface : 1; uint8_t nv_external_memory_capabilities : 1; diff --git a/thirdparty/vulkan/loader/vk_loader_platform.h b/thirdparty/vulkan/loader/vk_loader_platform.h index 62e8e3ae09..e227bf07b2 100644 --- a/thirdparty/vulkan/loader/vk_loader_platform.h +++ b/thirdparty/vulkan/loader/vk_loader_platform.h @@ -38,7 +38,6 @@ //#ifndef _GNU_SOURCE //#define _GNU_SOURCE 1 //#endif -// TBD: Are the contents of the following file used? #include <unistd.h> // Note: The following file is for dynamic loading: #include <dlfcn.h> @@ -100,13 +99,43 @@ static inline bool loader_platform_is_path_absolute(const char *path) { static inline char *loader_platform_dirname(char *path) { return dirname(path); } +#if defined(__linux__) + +// find application path + name. Path cannot be longer than 1024, returns NULL if it is greater than that. +static inline char *loader_platform_executable_path(char *buffer, size_t size) { + ssize_t count = readlink("/proc/self/exe", buffer, size); + if (count == -1) return NULL; + if (count == 0) return NULL; + buffer[count] = '\0'; + return buffer; +} +#elif defined(__APPLE__) // defined(__linux__) +#include <libproc.h> +static inline char *loader_platform_executable_path(char *buffer, size_t size) { + pid_t pid = getpid(); + int ret = proc_pidpath(pid, buffer, size); + if (ret <= 0) return NULL; + buffer[ret] = '\0'; + return buffer; +} +#endif // defined (__APPLE__) + +// Compatability with compilers that don't support __has_feature +#ifndef __has_feature +#define __has_feature(x) 0 +#endif + +#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) +#define LOADER_ADDRESS_SANITIZER +#endif + // Dynamic Loading of libraries: typedef void *loader_platform_dl_handle; static inline loader_platform_dl_handle loader_platform_open_library(const char *libPath) { - // When loading the library, we use RTLD_LAZY so that not all symbols have to be - // resolved at this time (which improves performance). Note that if not all symbols - // can be resolved, this could cause crashes later. Use the LD_BIND_NOW environment - // variable to force all symbols to be resolved here. +// When loading the library, we use RTLD_LAZY so that not all symbols have to be +// resolved at this time (which improves performance). Note that if not all symbols +// can be resolved, this could cause crashes later. Use the LD_BIND_NOW environment +// variable to force all symbols to be resolved here. return dlopen(libPath, RTLD_LAZY | RTLD_LOCAL); } static inline const char *loader_platform_open_library_error(const char *libPath) { return dlerror(); } @@ -162,6 +191,7 @@ static inline void loader_platform_thread_cond_broadcast(loader_platform_thread_ #include <io.h> #include <stdbool.h> #include <shlwapi.h> +#include <direct.h> #ifdef __cplusplus #include <iostream> #include <string> @@ -279,6 +309,14 @@ static inline char *loader_platform_dirname(char *path) { return path; } +static inline char *loader_platform_executable_path(char *buffer, size_t size) { + DWORD ret = GetModuleFileName(NULL, buffer, (DWORD)size); + if (ret == 0) return NULL; + if (ret > size) return NULL; + buffer[ret] = '\0'; + return buffer; +} + // Dynamic Loading: typedef HMODULE loader_platform_dl_handle; static loader_platform_dl_handle loader_platform_open_library(const char *lib_path) { @@ -330,25 +368,9 @@ typedef HANDLE loader_platform_thread; // The once init functionality is not used when building a DLL on Windows. This is because there is no way to clean up the // resources allocated by anything allocated by once init. This isn't a problem for static libraries, but it is for dynamic // ones. When building a DLL, we use DllMain() instead to allow properly cleaning up resources. -#if defined(LOADER_DYNAMIC_LIB) #define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var) #define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var) #define LOADER_PLATFORM_THREAD_ONCE(ctl, func) -#else -#define LOADER_PLATFORM_THREAD_ONCE_DECLARATION(var) INIT_ONCE var = INIT_ONCE_STATIC_INIT; -#define LOADER_PLATFORM_THREAD_ONCE_DEFINITION(var) INIT_ONCE var; -#define LOADER_PLATFORM_THREAD_ONCE(ctl, func) loader_platform_thread_once_fn(ctl, func) -static BOOL CALLBACK InitFuncWrapper(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *Context) { - void (*func)(void) = (void (*)(void))Parameter; - func(); - return TRUE; -} -static void loader_platform_thread_once_fn(void *ctl, void (*func)(void)) { - assert(func != NULL); - assert(ctl != NULL); - InitOnceExecuteOnce((PINIT_ONCE)ctl, InitFuncWrapper, (void *)func, NULL); -} -#endif // Thread IDs: typedef DWORD loader_platform_thread_id; diff --git a/thirdparty/vulkan/loader/vk_object_types.h b/thirdparty/vulkan/loader/vk_object_types.h index 7fdf77aa6a..16d22c8241 100644 --- a/thirdparty/vulkan/loader/vk_object_types.h +++ b/thirdparty/vulkan/loader/vk_object_types.h @@ -37,16 +37,16 @@ // Object Type enum for validation layer internal object handling typedef enum VulkanObjectType { kVulkanObjectTypeUnknown = 0, - kVulkanObjectTypeInstance = 1, - kVulkanObjectTypePhysicalDevice = 2, - kVulkanObjectTypeDevice = 3, - kVulkanObjectTypeQueue = 4, - kVulkanObjectTypeSemaphore = 5, - kVulkanObjectTypeCommandBuffer = 6, - kVulkanObjectTypeFence = 7, - kVulkanObjectTypeDeviceMemory = 8, - kVulkanObjectTypeBuffer = 9, - kVulkanObjectTypeImage = 10, + kVulkanObjectTypeBuffer = 1, + kVulkanObjectTypeImage = 2, + kVulkanObjectTypeInstance = 3, + kVulkanObjectTypePhysicalDevice = 4, + kVulkanObjectTypeDevice = 5, + kVulkanObjectTypeQueue = 6, + kVulkanObjectTypeSemaphore = 7, + kVulkanObjectTypeCommandBuffer = 8, + kVulkanObjectTypeFence = 9, + kVulkanObjectTypeDeviceMemory = 10, kVulkanObjectTypeEvent = 11, kVulkanObjectTypeQueryPool = 12, kVulkanObjectTypeBufferView = 13, @@ -54,12 +54,12 @@ typedef enum VulkanObjectType { kVulkanObjectTypeShaderModule = 15, kVulkanObjectTypePipelineCache = 16, kVulkanObjectTypePipelineLayout = 17, - kVulkanObjectTypeRenderPass = 18, - kVulkanObjectTypePipeline = 19, + kVulkanObjectTypePipeline = 18, + kVulkanObjectTypeRenderPass = 19, kVulkanObjectTypeDescriptorSetLayout = 20, kVulkanObjectTypeSampler = 21, - kVulkanObjectTypeDescriptorPool = 22, - kVulkanObjectTypeDescriptorSet = 23, + kVulkanObjectTypeDescriptorSet = 22, + kVulkanObjectTypeDescriptorPool = 23, kVulkanObjectTypeFramebuffer = 24, kVulkanObjectTypeCommandPool = 25, kVulkanObjectTypeSamplerYcbcrConversion = 26, @@ -68,22 +68,26 @@ typedef enum VulkanObjectType { kVulkanObjectTypeSwapchainKHR = 29, kVulkanObjectTypeDisplayKHR = 30, kVulkanObjectTypeDisplayModeKHR = 31, - kVulkanObjectTypeDebugReportCallbackEXT = 32, - kVulkanObjectTypeObjectTableNVX = 33, - kVulkanObjectTypeIndirectCommandsLayoutNVX = 34, - kVulkanObjectTypeDebugUtilsMessengerEXT = 35, - kVulkanObjectTypeValidationCacheEXT = 36, - kVulkanObjectTypeAccelerationStructureNV = 37, - kVulkanObjectTypePerformanceConfigurationINTEL = 38, - kVulkanObjectTypeMax = 39, + kVulkanObjectTypeDeferredOperationKHR = 32, + kVulkanObjectTypeDebugReportCallbackEXT = 33, + kVulkanObjectTypeDebugUtilsMessengerEXT = 34, + kVulkanObjectTypeValidationCacheEXT = 35, + kVulkanObjectTypeAccelerationStructureKHR = 36, + kVulkanObjectTypePerformanceConfigurationINTEL = 37, + kVulkanObjectTypeIndirectCommandsLayoutNV = 38, + kVulkanObjectTypePrivateDataSlotEXT = 39, + kVulkanObjectTypeMax = 40, // Aliases for backwards compatibilty of "promoted" types kVulkanObjectTypeDescriptorUpdateTemplateKHR = kVulkanObjectTypeDescriptorUpdateTemplate, kVulkanObjectTypeSamplerYcbcrConversionKHR = kVulkanObjectTypeSamplerYcbcrConversion, + kVulkanObjectTypeAccelerationStructureNV = kVulkanObjectTypeAccelerationStructureKHR, } VulkanObjectType; // Array of object name strings for OBJECT_TYPE enum conversion static const char * const object_string[kVulkanObjectTypeMax] = { "Unknown", + "Buffer", + "Image", "Instance", "PhysicalDevice", "Device", @@ -92,8 +96,6 @@ static const char * const object_string[kVulkanObjectTypeMax] = { "CommandBuffer", "Fence", "DeviceMemory", - "Buffer", - "Image", "Event", "QueryPool", "BufferView", @@ -101,12 +103,12 @@ static const char * const object_string[kVulkanObjectTypeMax] = { "ShaderModule", "PipelineCache", "PipelineLayout", - "RenderPass", "Pipeline", + "RenderPass", "DescriptorSetLayout", "Sampler", - "DescriptorPool", "DescriptorSet", + "DescriptorPool", "Framebuffer", "CommandPool", "SamplerYcbcrConversion", @@ -115,18 +117,21 @@ static const char * const object_string[kVulkanObjectTypeMax] = { "SwapchainKHR", "DisplayKHR", "DisplayModeKHR", + "DeferredOperationKHR", "DebugReportCallbackEXT", - "ObjectTableNVX", - "IndirectCommandsLayoutNVX", "DebugUtilsMessengerEXT", "ValidationCacheEXT", - "AccelerationStructureNV", + "AccelerationStructureKHR", "PerformanceConfigurationINTEL", + "IndirectCommandsLayoutNV", + "PrivateDataSlotEXT", }; // Helper array to get Vulkan VK_EXT_debug_report object type enum from the internal layers version const VkDebugReportObjectTypeEXT get_debug_report_enum[] = { VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypeUnknown + VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, // kVulkanObjectTypeBuffer + VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, // kVulkanObjectTypeImage VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, // kVulkanObjectTypeInstance VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, // kVulkanObjectTypePhysicalDevice VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, // kVulkanObjectTypeDevice @@ -135,8 +140,6 @@ const VkDebugReportObjectTypeEXT get_debug_report_enum[] = { VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, // kVulkanObjectTypeCommandBuffer VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, // kVulkanObjectTypeFence VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, // kVulkanObjectTypeDeviceMemory - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, // kVulkanObjectTypeBuffer - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, // kVulkanObjectTypeImage VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT, // kVulkanObjectTypeEvent VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, // kVulkanObjectTypeQueryPool VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT, // kVulkanObjectTypeBufferView @@ -144,12 +147,12 @@ const VkDebugReportObjectTypeEXT get_debug_report_enum[] = { VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT, // kVulkanObjectTypeShaderModule VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT, // kVulkanObjectTypePipelineCache VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT, // kVulkanObjectTypePipelineLayout - VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, // kVulkanObjectTypeRenderPass VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, // kVulkanObjectTypePipeline + VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, // kVulkanObjectTypeRenderPass VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT, // kVulkanObjectTypeDescriptorSetLayout VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT, // kVulkanObjectTypeSampler - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, // kVulkanObjectTypeDescriptorPool VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, // kVulkanObjectTypeDescriptorSet + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, // kVulkanObjectTypeDescriptorPool VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT, // kVulkanObjectTypeFramebuffer VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT, // kVulkanObjectTypeCommandPool VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, // kVulkanObjectTypeSamplerYcbcrConversion @@ -158,18 +161,21 @@ const VkDebugReportObjectTypeEXT get_debug_report_enum[] = { VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, // kVulkanObjectTypeSwapchainKHR VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT, // kVulkanObjectTypeDisplayKHR VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT, // kVulkanObjectTypeDisplayModeKHR + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypeDeferredOperationKHR VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT, // kVulkanObjectTypeDebugReportCallbackEXT - VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT, // kVulkanObjectTypeObjectTableNVX - VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT, // kVulkanObjectTypeIndirectCommandsLayoutNVX VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypeDebugUtilsMessengerEXT VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, // kVulkanObjectTypeValidationCacheEXT - VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT, // kVulkanObjectTypeAccelerationStructureNV + VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT, // kVulkanObjectTypeAccelerationStructureKHR VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypePerformanceConfigurationINTEL + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypeIndirectCommandsLayoutNV + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypePrivateDataSlotEXT }; // Helper array to get Official Vulkan VkObjectType enum from the internal layers version const VkObjectType get_object_type_enum[] = { VK_OBJECT_TYPE_UNKNOWN, // kVulkanObjectTypeUnknown + VK_OBJECT_TYPE_BUFFER, // kVulkanObjectTypeBuffer + VK_OBJECT_TYPE_IMAGE, // kVulkanObjectTypeImage VK_OBJECT_TYPE_INSTANCE, // kVulkanObjectTypeInstance VK_OBJECT_TYPE_PHYSICAL_DEVICE, // kVulkanObjectTypePhysicalDevice VK_OBJECT_TYPE_DEVICE, // kVulkanObjectTypeDevice @@ -178,8 +184,6 @@ const VkObjectType get_object_type_enum[] = { VK_OBJECT_TYPE_COMMAND_BUFFER, // kVulkanObjectTypeCommandBuffer VK_OBJECT_TYPE_FENCE, // kVulkanObjectTypeFence VK_OBJECT_TYPE_DEVICE_MEMORY, // kVulkanObjectTypeDeviceMemory - VK_OBJECT_TYPE_BUFFER, // kVulkanObjectTypeBuffer - VK_OBJECT_TYPE_IMAGE, // kVulkanObjectTypeImage VK_OBJECT_TYPE_EVENT, // kVulkanObjectTypeEvent VK_OBJECT_TYPE_QUERY_POOL, // kVulkanObjectTypeQueryPool VK_OBJECT_TYPE_BUFFER_VIEW, // kVulkanObjectTypeBufferView @@ -187,12 +191,12 @@ const VkObjectType get_object_type_enum[] = { VK_OBJECT_TYPE_SHADER_MODULE, // kVulkanObjectTypeShaderModule VK_OBJECT_TYPE_PIPELINE_CACHE, // kVulkanObjectTypePipelineCache VK_OBJECT_TYPE_PIPELINE_LAYOUT, // kVulkanObjectTypePipelineLayout - VK_OBJECT_TYPE_RENDER_PASS, // kVulkanObjectTypeRenderPass VK_OBJECT_TYPE_PIPELINE, // kVulkanObjectTypePipeline + VK_OBJECT_TYPE_RENDER_PASS, // kVulkanObjectTypeRenderPass VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, // kVulkanObjectTypeDescriptorSetLayout VK_OBJECT_TYPE_SAMPLER, // kVulkanObjectTypeSampler - VK_OBJECT_TYPE_DESCRIPTOR_POOL, // kVulkanObjectTypeDescriptorPool VK_OBJECT_TYPE_DESCRIPTOR_SET, // kVulkanObjectTypeDescriptorSet + VK_OBJECT_TYPE_DESCRIPTOR_POOL, // kVulkanObjectTypeDescriptorPool VK_OBJECT_TYPE_FRAMEBUFFER, // kVulkanObjectTypeFramebuffer VK_OBJECT_TYPE_COMMAND_POOL, // kVulkanObjectTypeCommandPool VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION, // kVulkanObjectTypeSamplerYcbcrConversion @@ -201,13 +205,14 @@ const VkObjectType get_object_type_enum[] = { VK_OBJECT_TYPE_SWAPCHAIN_KHR, // kVulkanObjectTypeSwapchainKHR VK_OBJECT_TYPE_DISPLAY_KHR, // kVulkanObjectTypeDisplayKHR VK_OBJECT_TYPE_DISPLAY_MODE_KHR, // kVulkanObjectTypeDisplayModeKHR + VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR, // kVulkanObjectTypeDeferredOperationKHR VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT, // kVulkanObjectTypeDebugReportCallbackEXT - VK_OBJECT_TYPE_OBJECT_TABLE_NVX, // kVulkanObjectTypeObjectTableNVX - VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX, // kVulkanObjectTypeIndirectCommandsLayoutNVX VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT, // kVulkanObjectTypeDebugUtilsMessengerEXT VK_OBJECT_TYPE_VALIDATION_CACHE_EXT, // kVulkanObjectTypeValidationCacheEXT - VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV, // kVulkanObjectTypeAccelerationStructureNV + VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR, // kVulkanObjectTypeAccelerationStructureKHR VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL, // kVulkanObjectTypePerformanceConfigurationINTEL + VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV, // kVulkanObjectTypeIndirectCommandsLayoutNV + VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT, // kVulkanObjectTypePrivateDataSlotEXT }; // Helper function to convert from VkDebugReportObjectTypeEXT to VkObjectType @@ -282,10 +287,8 @@ static inline VkObjectType convertDebugReportObjectToCoreObject(VkDebugReportObj return VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT; } else if (debug_report_obj == VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT) { return VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR; - } else if (debug_report_obj == VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT) { - return VK_OBJECT_TYPE_OBJECT_TABLE_NVX; - } else if (debug_report_obj == VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT) { - return VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX; + } else if (debug_report_obj == VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT) { + return VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR; } else if (debug_report_obj == VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT) { return VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR; } else if (debug_report_obj == VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT) { @@ -368,10 +371,8 @@ static inline VkDebugReportObjectTypeEXT convertCoreObjectToDebugReportObject(Vk return VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT; } else if (core_report_obj == VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR) { return VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT; - } else if (core_report_obj == VK_OBJECT_TYPE_OBJECT_TABLE_NVX) { - return VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT; - } else if (core_report_obj == VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX) { - return VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT; + } else if (core_report_obj == VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR) { + return VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT; } else if (core_report_obj == VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR) { return VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT; } else if (core_report_obj == VK_OBJECT_TYPE_VALIDATION_CACHE_EXT) { diff --git a/thirdparty/vulkan/loader/wsi.c b/thirdparty/vulkan/loader/wsi.c index f8d8e5374c..804046cf95 100644 --- a/thirdparty/vulkan/loader/wsi.c +++ b/thirdparty/vulkan/loader/wsi.c @@ -52,6 +52,9 @@ void wsi_create_instance(struct loader_instance *ptr_instance, const VkInstanceC #ifdef VK_USE_PLATFORM_XLIB_KHR ptr_instance->wsi_xlib_surface_enabled = false; #endif // VK_USE_PLATFORM_XLIB_KHR +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + ptr_instance->wsi_directfb_surface_enabled = false; +#endif // VK_USE_PLATFORM_DIRECTFB_EXT #ifdef VK_USE_PLATFORM_ANDROID_KHR ptr_instance->wsi_android_surface_enabled = false; #endif // VK_USE_PLATFORM_ANDROID_KHR @@ -96,6 +99,12 @@ void wsi_create_instance(struct loader_instance *ptr_instance, const VkInstanceC continue; } #endif // VK_USE_PLATFORM_XLIB_KHR +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME) == 0) { + ptr_instance->wsi_directfb_surface_enabled = true; + continue; + } +#endif // VK_USE_PLATFORM_DIRECTFB_EXT #ifdef VK_USE_PLATFORM_ANDROID_KHR if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_ANDROID_SURFACE_EXTENSION_NAME) == 0) { ptr_instance->wsi_android_surface_enabled = true; @@ -154,6 +163,9 @@ bool wsi_unsupported_instance_extension(const VkExtensionProperties *ext_prop) { #ifndef VK_USE_PLATFORM_XLIB_KHR if (!strcmp(ext_prop->extensionName, "VK_KHR_xlib_surface")) return true; #endif // VK_USE_PLATFORM_XLIB_KHR +#ifndef VK_USE_PLATFORM_DIRECTFB_EXT + if (!strcmp(ext_prop->extensionName, "VK_EXT_directfb_surface")) return true; +#endif // VK_USE_PLATFORM_DIRECTFB_EXT return false; } @@ -942,6 +954,124 @@ VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceXlibPresentationSuppo } #endif // VK_USE_PLATFORM_XLIB_KHR +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + +// Functions for the VK_EXT_directfb_surface extension: + +// This is the trampoline entrypoint for CreateDirectFBSurfaceEXT +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateDirectFBSurfaceEXT(VkInstance instance, + const VkDirectFBSurfaceCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSurfaceKHR *pSurface) { + const VkLayerInstanceDispatchTable *disp; + disp = loader_get_instance_layer_dispatch(instance); + VkResult res; + + res = disp->CreateDirectFBSurfaceEXT(instance, pCreateInfo, pAllocator, pSurface); + return res; +} + +// This is the instance chain terminator function for CreateDirectFBSurfaceEXT +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDirectFBSurfaceEXT(VkInstance instance, + const VkDirectFBSurfaceCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkSurfaceKHR *pSurface) { + VkResult vkRes = VK_SUCCESS; + VkIcdSurface *pIcdSurface = NULL; + uint32_t i = 0; + + // First, check to ensure the appropriate extension was enabled: + struct loader_instance *ptr_instance = loader_get_instance(instance); + if (!ptr_instance->wsi_directfb_surface_enabled) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "VK_EXT_directfb_surface extension not enabled. vkCreateDirectFBSurfaceEXT not executed!\n"); + vkRes = VK_ERROR_EXTENSION_NOT_PRESENT; + goto out; + } + + // Next, if so, proceed with the implementation of this function: + pIcdSurface = + AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->directfb_surf.base), sizeof(pIcdSurface->directfb_surf)); + if (pIcdSurface == NULL) { + vkRes = VK_ERROR_OUT_OF_HOST_MEMORY; + goto out; + } + + pIcdSurface->directfb_surf.base.platform = VK_ICD_WSI_PLATFORM_DIRECTFB; + pIcdSurface->directfb_surf.dfb = pCreateInfo->dfb; + pIcdSurface->directfb_surf.surface = pCreateInfo->surface; + + // Loop through each ICD and determine if they need to create a surface + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) { + if (NULL != icd_term->dispatch.CreateDirectFBSurfaceEXT) { + vkRes = icd_term->dispatch.CreateDirectFBSurfaceEXT(icd_term->instance, pCreateInfo, pAllocator, + &pIcdSurface->real_icd_surfaces[i]); + if (VK_SUCCESS != vkRes) { + goto out; + } + } + } + } + + *pSurface = (VkSurfaceKHR)pIcdSurface; + +out: + + if (VK_SUCCESS != vkRes && NULL != pIcdSurface) { + if (NULL != pIcdSurface->real_icd_surfaces) { + i = 0; + for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) { + if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) { + icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator); + } + } + loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces); + } + loader_instance_heap_free(ptr_instance, pIcdSurface); + } + + return vkRes; +} + +// This is the trampoline entrypoint for +// GetPhysicalDeviceDirectFBPresentationSupportEXT +LOADER_EXPORT VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceDirectFBPresentationSupportEXT(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + IDirectFB *dfb) { + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + const VkLayerInstanceDispatchTable *disp; + disp = loader_get_instance_layer_dispatch(physicalDevice); + VkBool32 res = disp->GetPhysicalDeviceDirectFBPresentationSupportEXT(unwrapped_phys_dev, queueFamilyIndex, dfb); + return res; +} + +// This is the instance chain terminator function for +// GetPhysicalDeviceDirectFBPresentationSupportEXT +VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceDirectFBPresentationSupportEXT(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + IDirectFB *dfb) { + // First, check to ensure the appropriate extension was enabled: + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; + if (!ptr_instance->wsi_directfb_surface_enabled) { + loader_log( + ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "VK_EXT_directfb_surface extension not enabled. vkGetPhysicalDeviceWaylandPresentationSupportKHR not executed!\n"); + return VK_SUCCESS; + } + + if (NULL == icd_term->dispatch.GetPhysicalDeviceDirectFBPresentationSupportEXT) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "ICD for selected physical device is not exporting vkGetPhysicalDeviceDirectFBPresentationSupportEXT!\n"); + assert(false && "loader: null GetPhysicalDeviceDirectFBPresentationSupportEXT ICD pointer"); + } + + return icd_term->dispatch.GetPhysicalDeviceDirectFBPresentationSupportEXT(phys_dev_term->phys_dev, queueFamilyIndex, dfb); +} +#endif // VK_USE_PLATFORM_DIRECTFB_EXT + #ifdef VK_USE_PLATFORM_ANDROID_KHR // Functions for the VK_KHR_android_surface extension: @@ -1806,6 +1936,164 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneCapabilities2KHR(VkPhys pDisplayPlaneInfo->planeIndex, &pCapabilities->capabilities); } +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL +vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, + VkSurfaceCapabilities2KHR *pSurfaceCapabilities) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + return disp->GetPhysicalDeviceSurfaceCapabilities2KHR(unwrapped_phys_dev, pSurfaceInfo, pSurfaceCapabilities); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2KHR( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, + VkSurfaceCapabilities2KHR *pSurfaceCapabilities) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; + + if (!ptr_instance->wsi_surface_enabled) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfaceCapabilities2KHR not executed!\n"); + return VK_SUCCESS; + } + + VkIcdSurface *icd_surface = (VkIcdSurface *)(pSurfaceInfo->surface); + uint8_t icd_index = phys_dev_term->icd_index; + + if (icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR != NULL) { + VkBaseOutStructure *pNext = (VkBaseOutStructure *)pSurfaceCapabilities->pNext; + while (pNext != NULL) { + if ((int)pNext->sType == VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR) { + // Not all ICDs may be supporting VK_KHR_surface_protected_capabilities + // Initialize VkSurfaceProtectedCapabilitiesKHR.supportsProtected to false and + // if an ICD supports protected surfaces, it will reset it to true accordingly. + ((VkSurfaceProtectedCapabilitiesKHR *)pNext)->supportsProtected = VK_FALSE; + } + pNext = (VkBaseOutStructure *)pNext->pNext; + } + + // Pass the call to the driver, possibly unwrapping the ICD surface + if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) { + VkPhysicalDeviceSurfaceInfo2KHR info_copy = *pSurfaceInfo; + info_copy.surface = icd_surface->real_icd_surfaces[icd_index]; + return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev_term->phys_dev, &info_copy, + pSurfaceCapabilities); + } else { + return icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilities2KHR(phys_dev_term->phys_dev, pSurfaceInfo, + pSurfaceCapabilities); + } + } else { + // Emulate the call + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulating call in ICD \"%s\" using " + "vkGetPhysicalDeviceSurfaceCapabilitiesKHR", + icd_term->scanned_icd->lib_name); + + if (pSurfaceInfo->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulation found unrecognized structure type in " + "pSurfaceInfo->pNext - this struct will be ignored"); + } + + // Write to the VkSurfaceCapabilities2KHR struct + VkSurfaceKHR surface = pSurfaceInfo->surface; + if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) { + surface = icd_surface->real_icd_surfaces[icd_index]; + } + VkResult res = icd_term->dispatch.GetPhysicalDeviceSurfaceCapabilitiesKHR(phys_dev_term->phys_dev, surface, + &pSurfaceCapabilities->surfaceCapabilities); + + if (pSurfaceCapabilities->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceSurfaceCapabilities2KHR: Emulation found unrecognized structure type in " + "pSurfaceCapabilities->pNext - this struct will be ignored"); + } + return res; + } +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL +vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, + uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats) { + const VkLayerInstanceDispatchTable *disp; + VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice); + disp = loader_get_instance_layer_dispatch(physicalDevice); + return disp->GetPhysicalDeviceSurfaceFormats2KHR(unwrapped_phys_dev, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats); +} + +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, + uint32_t *pSurfaceFormatCount, + VkSurfaceFormat2KHR *pSurfaceFormats) { + struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice; + struct loader_icd_term *icd_term = phys_dev_term->this_icd_term; + struct loader_instance *ptr_instance = (struct loader_instance *)icd_term->this_instance; + + if (!ptr_instance->wsi_surface_enabled) { + loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, + "VK_KHR_surface extension not enabled. vkGetPhysicalDeviceSurfaceFormats2KHR not executed!\n"); + return VK_SUCCESS; + } + + VkIcdSurface *icd_surface = (VkIcdSurface *)(pSurfaceInfo->surface); + uint8_t icd_index = phys_dev_term->icd_index; + + if (icd_term->dispatch.GetPhysicalDeviceSurfaceFormats2KHR != NULL) { + // Pass the call to the driver, possibly unwrapping the ICD surface + if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) { + VkPhysicalDeviceSurfaceInfo2KHR info_copy = *pSurfaceInfo; + info_copy.surface = icd_surface->real_icd_surfaces[icd_index]; + return icd_term->dispatch.GetPhysicalDeviceSurfaceFormats2KHR(phys_dev_term->phys_dev, &info_copy, pSurfaceFormatCount, + pSurfaceFormats); + } else { + return icd_term->dispatch.GetPhysicalDeviceSurfaceFormats2KHR(phys_dev_term->phys_dev, pSurfaceInfo, + pSurfaceFormatCount, pSurfaceFormats); + } + } else { + // Emulate the call + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, 0, + "vkGetPhysicalDeviceSurfaceFormats2KHR: Emulating call in ICD \"%s\" using vkGetPhysicalDeviceSurfaceFormatsKHR", + icd_term->scanned_icd->lib_name); + + if (pSurfaceInfo->pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceSurfaceFormats2KHR: Emulation found unrecognized structure type in pSurfaceInfo->pNext " + "- this struct will be ignored"); + } + + VkSurfaceKHR surface = pSurfaceInfo->surface; + if (icd_surface->real_icd_surfaces != NULL && (void *)icd_surface->real_icd_surfaces[icd_index] != NULL) { + surface = icd_surface->real_icd_surfaces[icd_index]; + } + + if (*pSurfaceFormatCount == 0 || pSurfaceFormats == NULL) { + // Write to pSurfaceFormatCount + return icd_term->dispatch.GetPhysicalDeviceSurfaceFormatsKHR(phys_dev_term->phys_dev, surface, pSurfaceFormatCount, + NULL); + } else { + // Allocate a temporary array for the output of the old function + VkSurfaceFormatKHR *formats = loader_stack_alloc(*pSurfaceFormatCount * sizeof(VkSurfaceFormatKHR)); + if (formats == NULL) { + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + VkResult res = icd_term->dispatch.GetPhysicalDeviceSurfaceFormatsKHR(phys_dev_term->phys_dev, surface, + pSurfaceFormatCount, formats); + for (uint32_t i = 0; i < *pSurfaceFormatCount; ++i) { + pSurfaceFormats[i].surfaceFormat = formats[i]; + if (pSurfaceFormats[i].pNext != NULL) { + loader_log(icd_term->this_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, + "vkGetPhysicalDeviceSurfaceFormats2KHR: Emulation found unrecognized structure type in " + "pSurfaceFormats[%d].pNext - this struct will be ignored", + i); + } + } + return res; + } + } +} + bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, const char *name, void **addr) { *addr = NULL; @@ -1846,6 +2134,17 @@ bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, const char return true; } + // Functions for VK_KHR_get_surface_capabilities2 extension: + if (!strcmp("vkGetPhysicalDeviceSurfaceCapabilities2KHR", name)) { + *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceCapabilities2KHR : NULL; + return true; + } + + if (!strcmp("vkGetPhysicalDeviceSurfaceFormats2KHR", name)) { + *addr = ptr_instance->wsi_surface_enabled ? (void *)vkGetPhysicalDeviceSurfaceFormats2KHR : NULL; + return true; + } + // Functions for the VK_KHR_swapchain extension: // Note: This is a device extension, and its functions are statically @@ -1925,6 +2224,18 @@ bool wsi_swapchain_instance_gpa(struct loader_instance *ptr_instance, const char return true; } #endif // VK_USE_PLATFORM_XLIB_KHR +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + + // Functions for the VK_EXT_directfb_surface extension: + if (!strcmp("vkCreateDirectFBSurfaceEXT", name)) { + *addr = ptr_instance->wsi_directfb_surface_enabled ? (void *)vkCreateDirectFBSurfaceEXT : NULL; + return true; + } + if (!strcmp("vkGetPhysicalDeviceDirectFBPresentationSupportEXT", name)) { + *addr = ptr_instance->wsi_directfb_surface_enabled ? (void *)vkGetPhysicalDeviceDirectFBPresentationSupportEXT : NULL; + return true; + } +#endif // VK_USE_PLATFORM_DIRECTFB_EXT #ifdef VK_USE_PLATFORM_ANDROID_KHR // Functions for the VK_KHR_android_surface extension: diff --git a/thirdparty/vulkan/loader/wsi.h b/thirdparty/vulkan/loader/wsi.h index 3e44efa9e9..e6c699f58a 100644 --- a/thirdparty/vulkan/loader/wsi.h +++ b/thirdparty/vulkan/loader/wsi.h @@ -39,6 +39,9 @@ typedef struct { #ifdef VK_USE_PLATFORM_XLIB_KHR VkIcdSurfaceXlib xlib_surf; #endif // VK_USE_PLATFORM_XLIB_KHR +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT + VkIcdSurfaceDirectFB directfb_surf; +#endif // VK_USE_PLATFORM_DIRECTFB_EXT #ifdef VK_USE_PLATFORM_MACOS_MVK VkIcdSurfaceMacOS macos_surf; #endif // VK_USE_PLATFORM_MACOS_MVK @@ -121,6 +124,14 @@ VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceXlibPresentationSuppo uint32_t queueFamilyIndex, Display *dpy, VisualID visualID); #endif +#ifdef VK_USE_PLATFORM_DIRECTFB_EXT +VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDirectFBSurfaceEXT(VkInstance instance, + const VkDirectFBSurfaceCreateInfoEXT *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); +VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceDirectFBPresentationSupportEXT(VkPhysicalDevice physicalDevice, + uint32_t queueFamilyIndex, + IDirectFB *dfb); +#endif #ifdef VK_USE_PLATFORM_MACOS_MVK VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateMacOSSurfaceMVK(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface); @@ -181,4 +192,13 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneCapabilities2KHR(VkPhys const VkDisplayPlaneInfo2KHR *pDisplayPlaneInfo, VkDisplayPlaneCapabilities2KHR *pCapabilities); +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2KHR( + VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, + VkSurfaceCapabilities2KHR *pSurfaceCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, + uint32_t *pSurfaceFormatCount, + VkSurfaceFormat2KHR *pSurfaceFormats); + #endif // WSI_H |