# ~~~
# Copyright (c) 2014-2023 Valve Corporation
# Copyright (c) 2014-2023 LunarG, Inc.
+# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2023 RasterGrid Kft.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
project(VULKAN_LOADER VERSION 1.3.274 LANGUAGES C)
+# This variable enables downstream users to customize the target API
+# variant (e.g. Vulkan SC)
+set(API_TYPE "vulkan")
+
add_subdirectory(scripts)
set(CMAKE_C_STANDARD 99)
add_custom_target(loader_codegen
COMMAND Python3::Interpreter ${PROJECT_SOURCE_DIR}/scripts/generate_source.py
"${VULKAN_HEADERS_INSTALL_DIR}/${CMAKE_INSTALL_DATADIR}/vulkan/registry"
- --generated-version ${VulkanHeaders_VERSION} --incremental
+ --generated-version ${VulkanHeaders_VERSION} --incremental --api ${API_TYPE}
)
endif()
# Copyright (c) 2014-2023 Valve Corporation
# Copyright (c) 2014-2023 LunarG, Inc.
# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2023 RasterGrid Kft.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
SHARED
${NORMAL_LOADER_SRCS}
${LOADER_UNKNOWN_CHAIN_LIBRARY}
- ${CMAKE_CURRENT_SOURCE_DIR}/vulkan-1.def
+ ${CMAKE_CURRENT_SOURCE_DIR}/${API_TYPE}-1.def
${RC_FILE_LOCATION})
target_link_libraries(vulkan PRIVATE loader_specific_options loader-opt)
# msvc: vulkan-1.lib / vulkan-1.dll
set_target_properties(vulkan
PROPERTIES
- OUTPUT_NAME vulkan-1)
+ OUTPUT_NAME ${API_TYPE}-1)
if(MINGW)
# generate the same DLL with mingw
set_target_properties(vulkan
target_link_libraries(vulkan PRIVATE ${CMAKE_DL_LIBS} m Threads::Threads)
+ set_target_properties(vulkan PROPERTIES OUTPUT_NAME ${API_TYPE})
+
if (LOADER_ENABLE_ADDRESS_SANITIZER)
target_compile_options(vulkan PUBLIC -fsanitize=address)
target_link_options(vulkan PUBLIC -fsanitize=address)
file(RELATIVE_PATH CMAKE_INSTALL_INCLUDEDIR_PC ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_INCLUDEDIR})
endif()
configure_file("vulkan.pc.in" "vulkan.pc" @ONLY)
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/vulkan.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/vulkan.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" RENAME "${API_TYPE}.pc")
endif()
* Copyright (c) 2015-2022 The Khronos Group Inc.
* Copyright (c) 2015-2022 Valve Corporation
* Copyright (c) 2015-2022 LunarG, Inc.
+ * Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * Copyright (c) 2023-2023 RasterGrid Kft.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// Manually add in GetPhysicalDeviceProcAddr entry
PFN_GetPhysicalDeviceProcAddr GetPhysicalDeviceProcAddr;
- // ---- Core 1_0 commands
+ // ---- Core Vulkan 1.0 commands
PFN_vkCreateInstance CreateInstance;
PFN_vkDestroyInstance DestroyInstance;
PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
PFN_vkEnumerateDeviceLayerProperties EnumerateDeviceLayerProperties;
PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties;
- // ---- Core 1_1 commands
+ // ---- Core Vulkan 1.1 commands
PFN_vkEnumerateInstanceVersion EnumerateInstanceVersion;
PFN_vkEnumeratePhysicalDeviceGroups EnumeratePhysicalDeviceGroups;
PFN_vkGetPhysicalDeviceFeatures2 GetPhysicalDeviceFeatures2;
PFN_vkGetPhysicalDeviceExternalFenceProperties GetPhysicalDeviceExternalFenceProperties;
PFN_vkGetPhysicalDeviceExternalSemaphoreProperties GetPhysicalDeviceExternalSemaphoreProperties;
- // ---- Core 1_3 commands
+ // ---- Core Vulkan 1.3 commands
PFN_vkGetPhysicalDeviceToolProperties GetPhysicalDeviceToolProperties;
// ---- VK_KHR_surface extension commands
typedef struct VkLayerDispatchTable_ {
uint64_t magic; // Should be DEVICE_DISP_TABLE_MAGIC_NUMBER
- // ---- Core 1_0 commands
+ // ---- Core Vulkan 1.0 commands
PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
PFN_vkDestroyDevice DestroyDevice;
PFN_vkGetDeviceQueue GetDeviceQueue;
PFN_vkCmdEndRenderPass CmdEndRenderPass;
PFN_vkCmdExecuteCommands CmdExecuteCommands;
- // ---- Core 1_1 commands
+ // ---- Core Vulkan 1.1 commands
PFN_vkBindBufferMemory2 BindBufferMemory2;
PFN_vkBindImageMemory2 BindImageMemory2;
PFN_vkGetDeviceGroupPeerMemoryFeatures GetDeviceGroupPeerMemoryFeatures;
PFN_vkUpdateDescriptorSetWithTemplate UpdateDescriptorSetWithTemplate;
PFN_vkGetDescriptorSetLayoutSupport GetDescriptorSetLayoutSupport;
- // ---- Core 1_2 commands
+ // ---- Core Vulkan 1.2 commands
PFN_vkCmdDrawIndirectCount CmdDrawIndirectCount;
PFN_vkCmdDrawIndexedIndirectCount CmdDrawIndexedIndirectCount;
PFN_vkCreateRenderPass2 CreateRenderPass2;
PFN_vkGetBufferOpaqueCaptureAddress GetBufferOpaqueCaptureAddress;
PFN_vkGetDeviceMemoryOpaqueCaptureAddress GetDeviceMemoryOpaqueCaptureAddress;
- // ---- Core 1_3 commands
+ // ---- Core Vulkan 1.3 commands
PFN_vkCreatePrivateDataSlot CreatePrivateDataSlot;
PFN_vkDestroyPrivateDataSlot DestroyPrivateDataSlot;
PFN_vkSetPrivateData SetPrivateData;
* Copyright (c) 2015-2022 The Khronos Group Inc.
* Copyright (c) 2015-2022 Valve Corporation
* Copyright (c) 2015-2022 LunarG, Inc.
+ * Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * Copyright (c) 2023-2023 RasterGrid Kft.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
} while (0)
- // ---- Core 1_0
+ // ---- Core Vulkan 1.0
LOOKUP_REQUIRED_GIPA(DestroyInstance);
LOOKUP_REQUIRED_GIPA(EnumeratePhysicalDevices);
LOOKUP_REQUIRED_GIPA(GetPhysicalDeviceFeatures);
LOOKUP_REQUIRED_GIPA(EnumerateDeviceExtensionProperties);
LOOKUP_REQUIRED_GIPA(GetPhysicalDeviceSparseImageFormatProperties);
- // ---- Core 1_1
+ // ---- Core Vulkan 1.1
LOOKUP_GIPA(EnumeratePhysicalDeviceGroups);
LOOKUP_GIPA(GetPhysicalDeviceFeatures2);
LOOKUP_GIPA(GetPhysicalDeviceProperties2);
LOOKUP_GIPA(GetPhysicalDeviceExternalFenceProperties);
LOOKUP_GIPA(GetPhysicalDeviceExternalSemaphoreProperties);
- // ---- Core 1_3
+ // ---- Core Vulkan 1.3
LOOKUP_GIPA(GetPhysicalDeviceToolProperties);
// ---- VK_KHR_surface extension commands
if (table->magic != DEVICE_DISP_TABLE_MAGIC_NUMBER) { abort(); }
for (uint32_t i = 0; i < MAX_NUM_UNKNOWN_EXTS; i++) dev_table->ext_dispatch[i] = (PFN_vkDevExt)vkDevExtError;
- // ---- Core 1_0 commands
+ // ---- Core Vulkan 1.0 commands
table->GetDeviceProcAddr = gpa;
table->DestroyDevice = (PFN_vkDestroyDevice)gpa(dev, "vkDestroyDevice");
table->GetDeviceQueue = (PFN_vkGetDeviceQueue)gpa(dev, "vkGetDeviceQueue");
table->CmdEndRenderPass = (PFN_vkCmdEndRenderPass)gpa(dev, "vkCmdEndRenderPass");
table->CmdExecuteCommands = (PFN_vkCmdExecuteCommands)gpa(dev, "vkCmdExecuteCommands");
- // ---- Core 1_1 commands
+ // ---- Core Vulkan 1.1 commands
table->BindBufferMemory2 = (PFN_vkBindBufferMemory2)gpa(dev, "vkBindBufferMemory2");
table->BindImageMemory2 = (PFN_vkBindImageMemory2)gpa(dev, "vkBindImageMemory2");
table->GetDeviceGroupPeerMemoryFeatures = (PFN_vkGetDeviceGroupPeerMemoryFeatures)gpa(dev, "vkGetDeviceGroupPeerMemoryFeatures");
table->UpdateDescriptorSetWithTemplate = (PFN_vkUpdateDescriptorSetWithTemplate)gpa(dev, "vkUpdateDescriptorSetWithTemplate");
table->GetDescriptorSetLayoutSupport = (PFN_vkGetDescriptorSetLayoutSupport)gpa(dev, "vkGetDescriptorSetLayoutSupport");
- // ---- Core 1_2 commands
+ // ---- Core Vulkan 1.2 commands
table->CmdDrawIndirectCount = (PFN_vkCmdDrawIndirectCount)gpa(dev, "vkCmdDrawIndirectCount");
table->CmdDrawIndexedIndirectCount = (PFN_vkCmdDrawIndexedIndirectCount)gpa(dev, "vkCmdDrawIndexedIndirectCount");
table->CreateRenderPass2 = (PFN_vkCreateRenderPass2)gpa(dev, "vkCreateRenderPass2");
table->GetBufferOpaqueCaptureAddress = (PFN_vkGetBufferOpaqueCaptureAddress)gpa(dev, "vkGetBufferOpaqueCaptureAddress");
table->GetDeviceMemoryOpaqueCaptureAddress = (PFN_vkGetDeviceMemoryOpaqueCaptureAddress)gpa(dev, "vkGetDeviceMemoryOpaqueCaptureAddress");
- // ---- Core 1_3 commands
+ // ---- Core Vulkan 1.3 commands
table->CreatePrivateDataSlot = (PFN_vkCreatePrivateDataSlot)gpa(dev, "vkCreatePrivateDataSlot");
table->DestroyPrivateDataSlot = (PFN_vkDestroyPrivateDataSlot)gpa(dev, "vkDestroyPrivateDataSlot");
table->SetPrivateData = (PFN_vkSetPrivateData)gpa(dev, "vkSetPrivateData");
VKAPI_ATTR void VKAPI_CALL loader_init_instance_core_dispatch_table(VkLayerInstanceDispatchTable *table, PFN_vkGetInstanceProcAddr gpa,
VkInstance inst) {
- // ---- Core 1_0 commands
+ // ---- Core Vulkan 1.0 commands
table->DestroyInstance = (PFN_vkDestroyInstance)gpa(inst, "vkDestroyInstance");
table->EnumeratePhysicalDevices = (PFN_vkEnumeratePhysicalDevices)gpa(inst, "vkEnumeratePhysicalDevices");
table->GetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures)gpa(inst, "vkGetPhysicalDeviceFeatures");
table->EnumerateDeviceLayerProperties = (PFN_vkEnumerateDeviceLayerProperties)gpa(inst, "vkEnumerateDeviceLayerProperties");
table->GetPhysicalDeviceSparseImageFormatProperties = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties)gpa(inst, "vkGetPhysicalDeviceSparseImageFormatProperties");
- // ---- Core 1_1 commands
+ // ---- Core Vulkan 1.1 commands
table->EnumeratePhysicalDeviceGroups = (PFN_vkEnumeratePhysicalDeviceGroups)gpa(inst, "vkEnumeratePhysicalDeviceGroups");
table->GetPhysicalDeviceFeatures2 = (PFN_vkGetPhysicalDeviceFeatures2)gpa(inst, "vkGetPhysicalDeviceFeatures2");
table->GetPhysicalDeviceProperties2 = (PFN_vkGetPhysicalDeviceProperties2)gpa(inst, "vkGetPhysicalDeviceProperties2");
table->GetPhysicalDeviceExternalFenceProperties = (PFN_vkGetPhysicalDeviceExternalFenceProperties)gpa(inst, "vkGetPhysicalDeviceExternalFenceProperties");
table->GetPhysicalDeviceExternalSemaphoreProperties = (PFN_vkGetPhysicalDeviceExternalSemaphoreProperties)gpa(inst, "vkGetPhysicalDeviceExternalSemaphoreProperties");
- // ---- Core 1_3 commands
+ // ---- Core Vulkan 1.3 commands
table->GetPhysicalDeviceToolProperties = (PFN_vkGetPhysicalDeviceToolProperties)gpa(inst, "vkGetPhysicalDeviceToolProperties");
}
uint32_t api_version = VK_MAKE_API_VERSION(0, inst->app_api_version.major, inst->app_api_version.minor, inst->app_api_version.patch);
- // ---- Core 1_0 commands
+ // ---- Core Vulkan 1.0 commands
if (!strcmp(name, "GetDeviceProcAddr")) {
if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_0) return NULL;
return (void *)table->GetDeviceProcAddr;
return (void *)table->CmdExecuteCommands;
}
- // ---- Core 1_1 commands
+ // ---- Core Vulkan 1.1 commands
if (!strcmp(name, "BindBufferMemory2")) {
if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_1) return NULL;
return (void *)table->BindBufferMemory2;
return (void *)table->GetDescriptorSetLayoutSupport;
}
- // ---- Core 1_2 commands
+ // ---- Core Vulkan 1.2 commands
if (!strcmp(name, "CmdDrawIndirectCount")) {
if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_2) return NULL;
return (void *)table->CmdDrawIndirectCount;
return (void *)table->GetDeviceMemoryOpaqueCaptureAddress;
}
- // ---- Core 1_3 commands
+ // ---- Core Vulkan 1.3 commands
if (!strcmp(name, "CreatePrivateDataSlot")) {
if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_3) return NULL;
return (void *)table->CreatePrivateDataSlot;
*found_name = true;
name += 2;
- // ---- Core 1_0 commands
+ // ---- Core Vulkan 1.0 commands
if (!strcmp(name, "DestroyInstance")) return (void *)table->DestroyInstance;
if (!strcmp(name, "EnumeratePhysicalDevices")) return (void *)table->EnumeratePhysicalDevices;
if (!strcmp(name, "GetPhysicalDeviceFeatures")) return (void *)table->GetPhysicalDeviceFeatures;
if (!strcmp(name, "EnumerateDeviceLayerProperties")) return (void *)table->EnumerateDeviceLayerProperties;
if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties")) return (void *)table->GetPhysicalDeviceSparseImageFormatProperties;
- // ---- Core 1_1 commands
+ // ---- Core Vulkan 1.1 commands
if (!strcmp(name, "EnumeratePhysicalDeviceGroups")) return (void *)table->EnumeratePhysicalDeviceGroups;
if (!strcmp(name, "GetPhysicalDeviceFeatures2")) return (void *)table->GetPhysicalDeviceFeatures2;
if (!strcmp(name, "GetPhysicalDeviceProperties2")) return (void *)table->GetPhysicalDeviceProperties2;
if (!strcmp(name, "GetPhysicalDeviceExternalFenceProperties")) return (void *)table->GetPhysicalDeviceExternalFenceProperties;
if (!strcmp(name, "GetPhysicalDeviceExternalSemaphoreProperties")) return (void *)table->GetPhysicalDeviceExternalSemaphoreProperties;
- // ---- Core 1_3 commands
+ // ---- Core Vulkan 1.3 commands
if (!strcmp(name, "GetPhysicalDeviceToolProperties")) return (void *)table->GetPhysicalDeviceToolProperties;
// ---- VK_KHR_surface extension commands
// pointers to "terminator functions".
const VkLayerInstanceDispatchTable instance_disp = {
- // ---- Core 1_0 commands
+ // ---- Core Vulkan 1.0 commands
.DestroyInstance = terminator_DestroyInstance,
.EnumeratePhysicalDevices = terminator_EnumeratePhysicalDevices,
.GetPhysicalDeviceFeatures = terminator_GetPhysicalDeviceFeatures,
.EnumerateDeviceLayerProperties = terminator_EnumerateDeviceLayerProperties,
.GetPhysicalDeviceSparseImageFormatProperties = terminator_GetPhysicalDeviceSparseImageFormatProperties,
- // ---- Core 1_1 commands
+ // ---- Core Vulkan 1.1 commands
.EnumeratePhysicalDeviceGroups = terminator_EnumeratePhysicalDeviceGroups,
.GetPhysicalDeviceFeatures2 = terminator_GetPhysicalDeviceFeatures2,
.GetPhysicalDeviceProperties2 = terminator_GetPhysicalDeviceProperties2,
.GetPhysicalDeviceExternalFenceProperties = terminator_GetPhysicalDeviceExternalFenceProperties,
.GetPhysicalDeviceExternalSemaphoreProperties = terminator_GetPhysicalDeviceExternalSemaphoreProperties,
- // ---- Core 1_3 commands
+ // ---- Core Vulkan 1.3 commands
.GetPhysicalDeviceToolProperties = terminator_GetPhysicalDeviceToolProperties,
// ---- VK_KHR_surface extension commands
* Copyright (c) 2015-2022 The Khronos Group Inc.
* Copyright (c) 2015-2022 Valve Corporation
* Copyright (c) 2015-2022 LunarG, Inc.
+ * Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * Copyright (c) 2023-2023 RasterGrid Kft.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// ICD function pointer dispatch table
struct loader_icd_term_dispatch {
- // ---- Core 1_0 commands
+ // ---- Core Vulkan 1.0 commands
PFN_vkCreateInstance CreateInstance;
PFN_vkDestroyInstance DestroyInstance;
PFN_vkEnumeratePhysicalDevices EnumeratePhysicalDevices;
PFN_vkEnumerateInstanceLayerProperties EnumerateInstanceLayerProperties;
PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties;
- // ---- Core 1_1 commands
+ // ---- Core Vulkan 1.1 commands
PFN_vkEnumerateInstanceVersion EnumerateInstanceVersion;
PFN_vkEnumeratePhysicalDeviceGroups EnumeratePhysicalDeviceGroups;
PFN_vkGetPhysicalDeviceFeatures2 GetPhysicalDeviceFeatures2;
PFN_vkGetPhysicalDeviceExternalFenceProperties GetPhysicalDeviceExternalFenceProperties;
PFN_vkGetPhysicalDeviceExternalSemaphoreProperties GetPhysicalDeviceExternalSemaphoreProperties;
- // ---- Core 1_3 commands
+ // ---- Core Vulkan 1.3 commands
PFN_vkGetPhysicalDeviceToolProperties GetPhysicalDeviceToolProperties;
// ---- VK_KHR_surface extension commands
* Copyright (c) 2014-2023 Valve Corporation
* Copyright (c) 2014-2023 LunarG, Inc.
* Copyright (C) 2015 Google Inc.
+ * Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * Copyright (c) 2023-2023 RasterGrid Kft.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
VkLayerDeviceLink *layer_device_link_info;
VkLayerDeviceCreateInfo chain_info;
VkDeviceCreateInfo loader_create_info;
- VkDeviceGroupDeviceCreateInfoKHR *original_device_group_create_info_struct = NULL;
+ VkDeviceGroupDeviceCreateInfo *original_device_group_create_info_struct = NULL;
VkResult res;
PFN_vkGetDeviceProcAddr fpGDPA = NULL, nextGDPA = loader_gpa_device_terminator;
}
// Before we continue, we need to find out if the KHR_device_group extension is in the enabled list. If it is, we then
- // need to look for the corresponding VkDeviceGroupDeviceCreateInfoKHR struct in the device list. This is because we
+ // need to look for the corresponding VkDeviceGroupDeviceCreateInfo struct in the device list. This is because we
// need to replace all the incoming physical device values (which are really loader trampoline physical device values)
// with the layer/ICD version.
{
VkBaseOutStructure *pPrev = (VkBaseOutStructure *)&loader_create_info;
while (NULL != pNext) {
if (VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO == pNext->sType) {
- VkDeviceGroupDeviceCreateInfoKHR *cur_struct = (VkDeviceGroupDeviceCreateInfoKHR *)pNext;
+ VkDeviceGroupDeviceCreateInfo *cur_struct = (VkDeviceGroupDeviceCreateInfo *)pNext;
if (0 < cur_struct->physicalDeviceCount && NULL != cur_struct->pPhysicalDevices) {
- VkDeviceGroupDeviceCreateInfoKHR *temp_struct = loader_stack_alloc(sizeof(VkDeviceGroupDeviceCreateInfoKHR));
+ VkDeviceGroupDeviceCreateInfo *temp_struct = loader_stack_alloc(sizeof(VkDeviceGroupDeviceCreateInfo));
VkPhysicalDevice *phys_dev_array = NULL;
if (NULL == temp_struct) {
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
- memcpy(temp_struct, cur_struct, sizeof(VkDeviceGroupDeviceCreateInfoKHR));
+ memcpy(temp_struct, cur_struct, sizeof(VkDeviceGroupDeviceCreateInfo));
phys_dev_array = loader_stack_alloc(sizeof(VkPhysicalDevice) * cur_struct->physicalDeviceCount);
if (NULL == phys_dev_array) {
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
temp_struct->pPhysicalDevices = phys_dev_array;
- original_device_group_create_info_struct = (VkDeviceGroupDeviceCreateInfoKHR *)pPrev->pNext;
+ original_device_group_create_info_struct = (VkDeviceGroupDeviceCreateInfo *)pPrev->pNext;
// Replace the old struct in the pNext chain with this one.
pPrev->pNext = (VkBaseOutStructure *)temp_struct;
}
dev->chain_device = created_device;
- // Because we changed the pNext chain to use our own VkDeviceGroupDeviceCreateInfoKHR, we need to fixup the chain to
- // point back at the original VkDeviceGroupDeviceCreateInfoKHR.
+ // Because we changed the pNext chain to use our own VkDeviceGroupDeviceCreateInfo, we need to fixup the chain to
+ // point back at the original VkDeviceGroupDeviceCreateInfo.
VkBaseOutStructure *pNext = (VkBaseOutStructure *)loader_create_info.pNext;
VkBaseOutStructure *pPrev = (VkBaseOutStructure *)&loader_create_info;
while (NULL != pNext) {
if (VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO == pNext->sType) {
- VkDeviceGroupDeviceCreateInfoKHR *cur_struct = (VkDeviceGroupDeviceCreateInfoKHR *)pNext;
+ VkDeviceGroupDeviceCreateInfo *cur_struct = (VkDeviceGroupDeviceCreateInfo *)pNext;
if (0 < cur_struct->physicalDeviceCount && NULL != cur_struct->pPhysicalDevices) {
pPrev->pNext = (VkBaseOutStructure *)original_device_group_create_info_struct;
}
// Create an instance, substituting the version to 1.0 if necessary
VkApplicationInfo icd_app_info;
+ const uint32_t api_variant = 0;
+ const uint32_t api_version_1_0 = VK_API_VERSION_1_0;
uint32_t icd_version_nopatch =
- VK_MAKE_API_VERSION(0, VK_API_VERSION_MAJOR(icd_version), VK_API_VERSION_MINOR(icd_version), 0);
+ VK_MAKE_API_VERSION(api_variant, VK_API_VERSION_MAJOR(icd_version), VK_API_VERSION_MINOR(icd_version), 0);
uint32_t requested_version = (pCreateInfo == NULL || pCreateInfo->pApplicationInfo == NULL)
- ? VK_API_VERSION_1_0
+ ? api_version_1_0
: pCreateInfo->pApplicationInfo->apiVersion;
- if ((requested_version != 0) && (icd_version_nopatch == VK_API_VERSION_1_0)) {
+ if ((requested_version != 0) && (icd_version_nopatch == api_version_1_0)) {
if (icd_create_info.pApplicationInfo == NULL) {
memset(&icd_app_info, 0, sizeof(icd_app_info));
} else {
struct loader_extension_list icd_exts;
VkBaseOutStructure *caller_dgci_container = NULL;
- VkDeviceGroupDeviceCreateInfoKHR *caller_dgci = NULL;
+ VkDeviceGroupDeviceCreateInfo *caller_dgci = NULL;
if (NULL == dev) {
loader_log(icd_term->this_instance, VULKAN_LOADER_WARN_BIT, 0,
}
case VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO: {
- const VkDeviceGroupDeviceCreateInfoKHR *group_info = pNext;
+ const VkDeviceGroupDeviceCreateInfo *group_info = pNext;
if (icd_term->dispatch.EnumeratePhysicalDeviceGroups == NULL &&
icd_term->dispatch.EnumeratePhysicalDeviceGroupsKHR == NULL) {
loader_destroy_generic_list(icd_term->this_instance, (struct loader_generic_list *)&icd_exts);
}
- // Restore pNext pointer to old VkDeviceGroupDeviceCreateInfoKHX
+ // Restore pNext pointer to old VkDeviceGroupDeviceCreateInfo
// in the chain to maintain consistency for the caller.
if (caller_dgci_container != NULL) {
caller_dgci_container->pNext = (VkBaseOutStructure *)caller_dgci;
struct loader_icd_term *icd_term;
uint32_t total_count = 0;
uint32_t cur_icd_group_count = 0;
- VkPhysicalDeviceGroupPropertiesKHR **new_phys_dev_groups = NULL;
+ VkPhysicalDeviceGroupProperties **new_phys_dev_groups = NULL;
struct loader_physical_device_group_term *local_phys_dev_groups = NULL;
PFN_vkEnumeratePhysicalDeviceGroups fpEnumeratePhysicalDeviceGroups = NULL;
struct loader_icd_physical_devices *sorted_phys_dev_array = NULL;
// 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++) {
+ cur_icd_group_count = 0;
+
// 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;
fpEnumeratePhysicalDeviceGroups = icd_term->dispatch.EnumeratePhysicalDeviceGroups;
}
- cur_icd_group_count = 0;
if (NULL == fpEnumeratePhysicalDeviceGroups) {
// Treat each ICD's GPU as it's own group if the extension isn't supported
res = icd_term->dispatch.EnumeratePhysicalDevices(icd_term->instance, &cur_icd_group_count, NULL);
VkPhysicalDeviceGroupProperties *tmp_group_props =
loader_stack_alloc(count_this_time * sizeof(VkPhysicalDeviceGroupProperties));
for (uint32_t group = 0; group < count_this_time; group++) {
- tmp_group_props[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR;
+ tmp_group_props[group].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES;
uint32_t cur_index = group + cur_icd_group_count;
if (*pPhysicalDeviceGroupCount > cur_index) {
tmp_group_props[group].pNext = pPhysicalDeviceGroupProperties[cur_index].pNext;
}
// 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);
+ new_phys_dev_groups[idx] = (VkPhysicalDeviceGroupProperties *)loader_instance_heap_alloc(
+ inst, sizeof(VkPhysicalDeviceGroupProperties), VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
if (NULL == new_phys_dev_groups[idx]) {
loader_log(inst, VULKAN_LOADER_ERROR_BIT, 0,
"terminator_EnumeratePhysicalDeviceGroups: Failed to allocate physical device group Terminator "
res = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
}
- memcpy(new_phys_dev_groups[idx], group_properties, sizeof(VkPhysicalDeviceGroupPropertiesKHR));
+ memcpy(new_phys_dev_groups[idx], group_properties, sizeof(VkPhysicalDeviceGroupProperties));
}
++idx;
* Copyright (c) 2014-2021 Valve Corporation
* Copyright (c) 2014-2021 LunarG, Inc.
* Copyright (C) 2015 Google Inc.
+ * Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * Copyright (c) 2023-2023 RasterGrid Kft.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceImageFormatProperties2(
- VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo,
- VkImageFormatProperties2KHR *pImageFormatProperties) {
+ VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo,
+ VkImageFormatProperties2 *pImageFormatProperties) {
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;
const struct loader_instance *inst = icd_term->this_instance;
VKAPI_ATTR void VKAPI_CALL terminator_GetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice,
uint32_t *pQueueFamilyPropertyCount,
- VkQueueFamilyProperties2KHR *pQueueFamilyProperties) {
+ VkQueueFamilyProperties2 *pQueueFamilyProperties) {
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;
const struct loader_instance *inst = icd_term->this_instance;
* Copyright (c) 2015-2023 Valve Corporation
* Copyright (c) 2015-2023 LunarG, Inc.
* Copyright (C) 2015 Google Inc.
+ * Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * Copyright (c) 2023-2023 RasterGrid Kft.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
- // Make sure the application provided API version has 0 for its variant
+ // Make sure the application provided API version has the correct variant
if (NULL != pCreateInfo->pApplicationInfo) {
uint32_t variant_version = VK_API_VERSION_VARIANT(pCreateInfo->pApplicationInfo->apiVersion);
- if (0 != variant_version) {
+ const uint32_t expected_variant = 0;
+ if (expected_variant != variant_version) {
loader_log(ptr_instance, VULKAN_LOADER_WARN_BIT, 0,
"vkCreateInstance: The API Variant specified in pCreateInfo->pApplicationInfo.apiVersion is %d instead of "
- "the expected value of 0.",
- variant_version);
+ "the expected value of %d.",
+ variant_version, expected_variant);
}
}
}
LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphoreProperties(
- VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfoKHR *pExternalSemaphoreInfo,
+ VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo *pExternalSemaphoreInfo,
VkExternalSemaphoreProperties *pExternalSemaphoreProperties) {
VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
if (VK_NULL_HANDLE == unwrapped_phys_dev) {
* Copyright (c) 2015-2022 The Khronos Group Inc.
* Copyright (c) 2015-2022 Valve Corporation
* Copyright (c) 2015-2022 LunarG, Inc.
+ * Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * Copyright (c) 2023-2023 RasterGrid Kft.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#define VK_ELAYERS_INFO_RELATIVE_DIR ""
#define VK_ILAYERS_INFO_RELATIVE_DIR ""
-#define VK_DRIVERS_INFO_REGISTRY_LOC "SOFTWARE\\Khronos\\Vulkan\\Drivers"
-#define VK_ELAYERS_INFO_REGISTRY_LOC "SOFTWARE\\Khronos\\Vulkan\\ExplicitLayers"
-#define VK_ILAYERS_INFO_REGISTRY_LOC "SOFTWARE\\Khronos\\Vulkan\\ImplicitLayers"
-#define VK_SETTINGS_INFO_REGISTRY_LOC "SOFTWARE\\Khronos\\Vulkan\\LoaderSettings"
+#define VK_VARIANT_REG_STR ""
+#define VK_VARIANT_REG_STR_W L""
+
+#define VK_DRIVERS_INFO_REGISTRY_LOC "SOFTWARE\\Khronos\\Vulkan" VK_VARIANT_REG_STR "\\Drivers"
+#define VK_ELAYERS_INFO_REGISTRY_LOC "SOFTWARE\\Khronos\\Vulkan" VK_VARIANT_REG_STR "\\ExplicitLayers"
+#define VK_ILAYERS_INFO_REGISTRY_LOC "SOFTWARE\\Khronos\\Vulkan" VK_VARIANT_REG_STR "\\ImplicitLayers"
+#define VK_SETTINGS_INFO_REGISTRY_LOC "SOFTWARE\\Khronos\\Vulkan" VK_VARIANT_REG_STR "\\LoaderSettings"
#define PRINTF_SIZE_T_SPECIFIER "%Iu"
static inline const char *LoaderPnpDriverRegistry() {
BOOL is_wow;
IsWow64Process(GetCurrentProcess(), &is_wow);
- return is_wow ? "VulkanDriverNameWow" : "VulkanDriverName";
+ return is_wow ? "Vulkan" VK_VARIANT_REG_STR "DriverNameWow" : "Vulkan" VK_VARIANT_REG_STR "DriverName";
}
static inline const wchar_t *LoaderPnpDriverRegistryWide() {
BOOL is_wow;
IsWow64Process(GetCurrentProcess(), &is_wow);
- return is_wow ? L"VulkanDriverNameWow" : L"VulkanDriverName";
+ return is_wow ? L"Vulkan" VK_VARIANT_REG_STR_W L"DriverNameWow" : L"Vulkan" VK_VARIANT_REG_STR_W L"DriverName";
}
// Get the key for the plug 'n play explicit layer registry
static inline const char *LoaderPnpELayerRegistry() {
BOOL is_wow;
IsWow64Process(GetCurrentProcess(), &is_wow);
- return is_wow ? "VulkanExplicitLayersWow" : "VulkanExplicitLayers";
+ return is_wow ? "Vulkan" VK_VARIANT_REG_STR "ExplicitLayersWow" : "Vulkan" VK_VARIANT_REG_STR "ExplicitLayers";
}
static inline const wchar_t *LoaderPnpELayerRegistryWide() {
BOOL is_wow;
IsWow64Process(GetCurrentProcess(), &is_wow);
- return is_wow ? L"VulkanExplicitLayersWow" : L"VulkanExplicitLayers";
+ return is_wow ? L"Vulkan" VK_VARIANT_REG_STR_W L"ExplicitLayersWow" : L"Vulkan" VK_VARIANT_REG_STR_W L"ExplicitLayers";
}
// Get the key for the plug 'n play implicit layer registry
static inline const char *LoaderPnpILayerRegistry() {
BOOL is_wow;
IsWow64Process(GetCurrentProcess(), &is_wow);
- return is_wow ? "VulkanImplicitLayersWow" : "VulkanImplicitLayers";
+ return is_wow ? "Vulkan" VK_VARIANT_REG_STR "ImplicitLayersWow" : "Vulkan" VK_VARIANT_REG_STR "ImplicitLayers";
}
static inline const wchar_t *LoaderPnpILayerRegistryWide() {
BOOL is_wow;
IsWow64Process(GetCurrentProcess(), &is_wow);
- return is_wow ? L"VulkanImplicitLayersWow" : L"VulkanImplicitLayers";
+ return is_wow ? L"Vulkan" VK_VARIANT_REG_STR_W L"ImplicitLayersWow" : L"Vulkan" VK_VARIANT_REG_STR_W L"ImplicitLayers";
}
// File IO
endif()
list(APPEND update_dep_command "--config")
list(APPEND update_dep_command "${_build_type}")
+ list(APPEND update_dep_command "--api")
+ list(APPEND update_dep_command "${API_TYPE}")
set(UPDATE_DEPS_DIR_SUFFIX "${_build_type}")
if (CMAKE_CROSSCOMPILING)
# Copyright (c) 2019 Valve Corporation
# Copyright (c) 2019 LunarG, Inc.
# Copyright (c) 2019 Google Inc.
+# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2023 RasterGrid Kft.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
def main(argv):
parser = argparse.ArgumentParser(description='Generate source code for this repository')
parser.add_argument('registry', metavar='REGISTRY_PATH', help='path to the Vulkan-Headers registry directory')
+ parser.add_argument('--api',
+ default='vulkan',
+ choices=['vulkan'],
+ help='Specify API name to generate')
parser.add_argument('--generated-version', help='sets the header version used to generate the repo')
group = parser.add_mutually_exclusive_group()
group.add_argument('-i', '--incremental', action='store_true', help='only update repo files that change')
"repos": [
{
"name": "Vulkan-Headers",
+ "api": "vulkan",
"url": "https://github.com/KhronosGroup/Vulkan-Headers.git",
"sub_dir": "Vulkan-Headers",
"build_dir": "Vulkan-Headers/build",
# Copyright (c) 2015-2022 Valve Corporation
# Copyright (c) 2015-2022 LunarG, Inc.
# Copyright (c) 2015-2017 Google Inc.
+# Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2023 RasterGrid Kft.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
'vkEnumerateInstanceLayerProperties',
'vkEnumerateInstanceVersion']
+#
+# API Version
+class APIVersion:
+ def __init__(self, token, apiname = 'Vulkan', supported = True):
+ self.token = token
+ self.constant = token.replace('_VERSION_', '_API_VERSION_')
+ self.number = token[token.find('_VERSION_') + len('_VERSION_'):].replace('_', '.')
+ self.name = f'{apiname} {self.number}'
+ self.supported = supported
+
#
# LoaderExtensionGeneratorOptions - subclass of GeneratorOptions.
class LoaderExtensionGeneratorOptions(GeneratorOptions):
copyright += ' * Copyright (c) 2015-2022 The Khronos Group Inc.\n'
copyright += ' * Copyright (c) 2015-2022 Valve Corporation\n'
copyright += ' * Copyright (c) 2015-2022 LunarG, Inc.\n'
+ copyright += ' * Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n'
+ copyright += ' * Copyright (c) 2023-2023 RasterGrid Kft.\n'
copyright += ' *\n'
copyright += ' * Licensed under the Apache License, Version 2.0 (the "License");\n'
copyright += ' * you may not use this file except in compliance with the License.\n'
result = str(result).replace('::', '->')
return result
+ #
+ # Returns an APIVersion object corresponding to the specified version token or None
+ def getAPIVersion(self, token):
+ if self.genOpts.apiname == 'vulkansc':
+ if token in ['VK_VERSION_1_0', 'VK_VERSION_1_1', 'VK_VERSION_1_2']:
+ # Vulkan 1.0-1.2 is included in Vulkan SC 1.0
+ token = 'VKSC_VERSION_1_0'
+
+ if token.startswith('VKSC_VERSION_'):
+ return APIVersion(token, 'Vulkan SC', True)
+ elif token.startswith('VK_VERSION_'):
+ # Unsupported Vulkan version
+ return APIVersion(token, 'Vulkan', False)
+ else:
+ return None
+
+ if token.startswith('VK_VERSION_'):
+ return APIVersion(token)
+ return None
+
#
# Determine if this API should be ignored or added to the instance or device dispatch table
def AddCommandToDispatchList(self, extension_name, extension_type, name, cmdinfo, handle_type):
cmd_params.append(self.CommandParam(type=param_type, name=param_name,
cdecl=param_cdecl))
+ version = self.getAPIVersion(extension_name)
+ if version and not version.supported:
+ # Skip commands in unsupported versions
+ return
+
if handle is not None and handle_type != 'VkInstance' and handle_type != 'VkPhysicalDevice':
# The Core Vulkan code will be wrapped in a feature called VK_VERSION_#_#
# For example: VK_VERSION_1_0 wraps the core 1.0 Vulkan functionality
- if 'VK_VERSION_' in extension_name:
+ if version:
self.core_commands.append(
- self.CommandData(name=name, ext_name=extension_name,
+ self.CommandData(name=name, ext_name=version.token,
ext_type='device',
require=require,
protect=self.featureExtraProtect,
else:
# The Core Vulkan code will be wrapped in a feature called VK_VERSION_#_#
# For example: VK_VERSION_1_0 wraps the core 1.0 Vulkan functionality
- if 'VK_VERSION_' in extension_name:
+ if version:
self.core_commands.append(
- self.CommandData(name=name, ext_name=extension_name,
+ self.CommandData(name=name, ext_name=version.token,
ext_type='instance',
require=require,
protect=self.featureExtraProtect,
commands = self.ext_commands
for cur_cmd in commands:
+ version = self.getAPIVersion(cur_cmd.ext_name)
is_inst_handle_type = cur_cmd.name in ADD_INST_CMDS or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice'
if is_inst_handle_type:
if cur_cmd.ext_name != cur_extension_name:
- if 'VK_VERSION_' in cur_cmd.ext_name:
- table += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:]
+ if version:
+ table += '\n // ---- Core %s commands\n' % version.name
else:
table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name
cur_extension_name = cur_cmd.ext_name
commands = self.ext_commands
for cur_cmd in commands:
+ version = self.getAPIVersion(cur_cmd.ext_name)
is_inst_handle_type = cur_cmd.name in ADD_INST_CMDS or cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice'
if not is_inst_handle_type:
if cur_cmd.ext_name != cur_extension_name:
- if 'VK_VERSION_' in cur_cmd.ext_name:
- table += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:]
+ if version:
+ table += '\n // ---- Core %s commands\n' % version.name
else:
table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name
cur_extension_name = cur_cmd.ext_name
commands = self.ext_commands
for cur_cmd in commands:
+ version = self.getAPIVersion(cur_cmd.ext_name)
if (self.ShouldPrintInIcdDispatchTable(cur_cmd, skip_commands)):
if cur_cmd.ext_name != cur_extension_name:
- if 'VK_VERSION_' in cur_cmd.ext_name:
- table += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:]
+ if version:
+ table += '\n // ---- Core %s commands\n' % version.name
else:
table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name
cur_extension_name = cur_cmd.ext_name
required = False
for cur_cmd in commands:
+ version = self.getAPIVersion(cur_cmd.ext_name)
if (self.ShouldPrintInIcdDispatchTable(cur_cmd, skip_gipa_commands)):
if cur_cmd.ext_name != cur_extension_name:
- if 'VK_VERSION_' in cur_cmd.ext_name:
- table += '\n // ---- Core %s\n' % cur_cmd.ext_name[11:]
- required = cur_cmd.ext_name == 'VK_VERSION_1_0'
+ if version:
+ table += '\n // ---- Core %s\n' % version.name
+ required = version.number == '1.0'
else:
table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name
required = False
union = ''
union += 'struct loader_instance_extension_enables {\n'
for ext in extensions:
- if ('VK_VERSION_' in ext.name or ext.name in WSI_EXT_NAMES or
+ if (self.getAPIVersion(ext.name) or ext.name in WSI_EXT_NAMES or
ext.type == 'device' or ext.num_commands == 0):
continue
tables += ' VkInstance inst) {\n'
for cur_cmd in commands:
+ version = self.getAPIVersion(cur_cmd.ext_name)
is_inst_handle_type = cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice'
if ((cur_type == 'instance' and is_inst_handle_type) or (cur_type == 'device' and not is_inst_handle_type)):
if cur_cmd.ext_name != cur_extension_name:
- if 'VK_VERSION_' in cur_cmd.ext_name:
- tables += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:]
+ if version:
+ tables += '\n // ---- Core %s commands\n' % version.name
else:
tables += '\n // ---- %s extension commands\n' % cur_cmd.ext_name
cur_extension_name = cur_cmd.ext_name
commands = self.ext_commands
for cur_cmd in commands:
+ version = self.getAPIVersion(cur_cmd.ext_name)
is_inst_handle_type = cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice'
if ((cur_type == 'instance' and is_inst_handle_type) or (cur_type == 'device' and not is_inst_handle_type)):
if cur_cmd.ext_name != cur_extension_name:
- if 'VK_VERSION_' in cur_cmd.ext_name:
- tables += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:]
+ if version:
+ tables += '\n // ---- Core %s commands\n' % version.name
if cur_type == 'device':
- version_check = f' if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_{cur_cmd.ext_name[11:]}) return NULL;\n'
+ version_check = f' if (dev->should_ignore_device_commands_from_newer_version && api_version < {version.constant}) return NULL;\n'
else:
tables += '\n // ---- %s extension commands\n' % cur_cmd.ext_name
ext_cmd.name in manual_ext_commands):
continue
+ version = self.getAPIVersion(ext_cmd.ext_name)
if ext_cmd.ext_name != cur_extension_name:
- if 'VK_VERSION_' in ext_cmd.ext_name:
- funcs += '\n// ---- Core %s trampoline/terminators\n\n' % ext_cmd.ext_name[11:]
+ if version:
+ funcs += '\n// ---- Core %s trampoline/terminators\n\n' % version.name
else:
funcs += '\n// ---- %s extension trampoline/terminators\n\n' % ext_cmd.ext_name
cur_extension_name = ext_cmd.ext_name
gpa_func += ' *addr = NULL;\n\n'
for cur_cmd in self.ext_commands:
- if ('VK_VERSION_' in cur_cmd.ext_name or
+ if (self.getAPIVersion(cur_cmd.ext_name) or
cur_cmd.ext_name in WSI_EXT_NAMES or
cur_cmd.ext_name in AVOID_EXT_NAMES or
cur_cmd.name in AVOID_CMD_NAMES ):
create_func += 'void extensions_create_instance(struct loader_instance *ptr_instance, const VkInstanceCreateInfo *pCreateInfo) {\n'
create_func += ' for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {\n'
for ext in entries:
- if ('VK_VERSION_' in ext.name or ext.name in WSI_EXT_NAMES or
+ if (self.getAPIVersion(ext.name) or ext.name in WSI_EXT_NAMES or
ext.name in AVOID_EXT_NAMES or ext.name in AVOID_CMD_NAMES or
ext.type == 'device' or ext.num_commands == 0):
continue
last_protect = None
last_ext = None
for ext_cmd in self.ext_commands:
+ version = self.getAPIVersion(ext_cmd.ext_name)
if ext_cmd.name in DEVICE_CMDS_NEED_TERM:
- if 'VK_VERSION_' in ext_cmd.ext_name:
- term_func += f' // ---- Core {ext_cmd.ext_name[11:]} commands\n'
+ if version:
+ term_func += f' // ---- Core {version.name} commands\n'
else:
last_protect = ext_cmd.protect
if ext_cmd.protect is not None:
last_protect = None
last_ext = None
for ext_cmd in self.ext_commands:
+ version = self.getAPIVersion(ext_cmd.ext_name)
if ext_cmd.name in DEVICE_CMDS_NEED_TERM:
- if 'VK_VERSION_' in ext_cmd.ext_name:
- term_func += f' // ---- Core {ext_cmd.ext_name[11:]} commands\n'
+ if version:
+ term_func += f' // ---- Core {version.name} commands\n'
else:
last_protect = ext_cmd.protect
if ext_cmd.protect is not None:
last_protect = None
last_ext = None
for ext_cmd in self.ext_commands:
+ version = self.getAPIVersion(ext_cmd.ext_name)
if ext_cmd.name in DEVICE_CMDS_MUST_USE_TRAMP:
- if 'VK_VERSION_' in ext_cmd.ext_name:
- tramp_protos += f' // ---- Core {ext_cmd.ext_name[11:]} commands\n'
+ if version:
+ tramp_protos += f' // ---- Core {version.name} commands\n'
else:
last_protect = ext_cmd.protect
if ext_cmd.protect is not None:
last_protect = None
last_ext = None
for ext_cmd in self.ext_commands:
+ version = self.getAPIVersion(ext_cmd.ext_name)
if ext_cmd.name in DEVICE_CMDS_NEED_TERM:
- if 'VK_VERSION_' in ext_cmd.ext_name:
- term_func += f' // ---- Core {ext_cmd.ext_name[11:]} commands\n'
+ if version:
+ term_func += f' // ---- Core {version.name} commands\n'
else:
last_protect = ext_cmd.protect
if ext_cmd.protect is not None:
commands = self.ext_commands
for cur_cmd in commands:
-
+ version = self.getAPIVersion(cur_cmd.ext_name)
if cur_cmd.handle_type == 'VkInstance' or cur_cmd.handle_type == 'VkPhysicalDevice':
if cur_cmd.ext_name != cur_extension_name:
- if 'VK_VERSION_' in cur_cmd.ext_name:
- table += '\n // ---- Core %s commands\n' % cur_cmd.ext_name[11:]
+ if version:
+ table += '\n // ---- Core %s commands\n' % version.name
else:
table += '\n // ---- %s extension commands\n' % cur_cmd.ext_name
cur_extension_name = cur_cmd.ext_name
table += '// before passing the list of extensions to the application.\n'
table += 'const char *const LOADER_INSTANCE_EXTENSIONS[] = {\n'
for ext in extensions:
- if ext.type == 'device' or 'VK_VERSION_' in ext.name:
+ if ext.type == 'device' or self.getAPIVersion(ext.name):
continue
if ext.protect is not None:
#!/usr/bin/python3
#
# Copyright (c) 2013-2019 The Khronos Group Inc.
+# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2023 RasterGrid Kft.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
global genOpts
genOpts = {}
+ # API to generate sources for
+ apiname = args.api
+
# Default class of extensions to include, or None
- defaultExtensions = args.defaultExtensions
+ if args.defaultExtensions is not None:
+ defaultExtensions = args.defaultExtensions
+ else:
+ defaultExtensions = apiname
# Additional extensions to include (list of extensions)
extensions = args.extension
filename = 'vk_dispatch_table_helper.h',
directory = directory,
genpath = None,
- apiname = 'vulkan',
+ apiname = apiname,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
- defaultExtensions = 'vulkan',
+ defaultExtensions = defaultExtensions,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
filename = 'vk_layer_dispatch_table.h',
directory = directory,
genpath = None,
- apiname = 'vulkan',
+ apiname = apiname,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
- defaultExtensions = 'vulkan',
+ defaultExtensions = defaultExtensions,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
filename = 'vk_loader_extensions.h',
directory = directory,
genpath = None,
- apiname = 'vulkan',
+ apiname = apiname,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
- defaultExtensions = 'vulkan',
+ defaultExtensions = defaultExtensions,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
filename = 'vk_loader_extensions.c',
directory = directory,
genpath = None,
- apiname = 'vulkan',
+ apiname = apiname,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
- defaultExtensions = 'vulkan',
+ defaultExtensions = defaultExtensions,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
filename = 'vk_object_types.h',
directory = directory,
genpath = None,
- apiname = 'vulkan',
+ apiname = apiname,
profile = None,
versions = featuresPat,
emitversions = featuresPat,
- defaultExtensions = 'vulkan',
+ defaultExtensions = defaultExtensions,
addExtensions = addExtensionsPat,
removeExtensions = removeExtensionsPat,
emitExtensions = emitExtensionsPat,
if not args.quiet:
write('* Building', options.filename, file=sys.stderr)
+ write('* options.apiname =', options.apiname, file=sys.stderr)
write('* options.versions =', options.versions, file=sys.stderr)
write('* options.emitversions =', options.emitversions, file=sys.stderr)
write('* options.defaultExtensions =', options.defaultExtensions, file=sys.stderr)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
- parser.add_argument('-defaultExtensions', action='store',
+ parser.add_argument('-api', action='store',
default='vulkan',
+ choices=['vulkan'],
+ help='Specify API name to generate')
+ parser.add_argument('-defaultExtensions', action='store',
+ default=None,
help='Specify a single class of extensions to add to targets')
parser.add_argument('-extension', action='append',
default=[],
* Copyright (c) 2021-2023 The Khronos Group Inc.
* Copyright (c) 2021-2023 Valve Corporation
* Copyright (c) 2021-2023 LunarG, Inc.
+ * Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * Copyright (c) 2023-2023 RasterGrid Kft.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and/or associated documentation files (the "Materials"), to
VKAPI_ATTR VkResult VKAPI_CALL test_vkCreateDisplayPlaneSurfaceKHR(
[[maybe_unused]] VkInstance instance, [[maybe_unused]] const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
[[maybe_unused]] const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {
- if (nullptr != pSurface) {
- uint64_t fake_surf_handle = reinterpret_cast<uint64_t>(new uint8_t);
- icd.surface_handles.push_back(fake_surf_handle);
-#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || \
- defined(_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
- *pSurface = reinterpret_cast<VkSurfaceKHR>(fake_surf_handle);
-#else
- *pSurface = fake_surf_handle;
-#endif
- }
+ common_nondispatch_handle_creation(icd.surface_handles, pSurface);
return VK_SUCCESS;
}
enum class GpuType { unspecified, integrated, discrete, external };
#if defined(WIN32)
+#define VK_VARIANT_REG_STR ""
+#define VK_VARIANT_REG_STR_W L""
+
+#define VK_DRIVERS_INFO_REGISTRY_LOC "SOFTWARE\\Khronos\\Vulkan" VK_VARIANT_REG_STR "\\Drivers"
+#define VK_ELAYERS_INFO_REGISTRY_LOC "SOFTWARE\\Khronos\\Vulkan" VK_VARIANT_REG_STR "\\ExplicitLayers"
+#define VK_ILAYERS_INFO_REGISTRY_LOC "SOFTWARE\\Khronos\\Vulkan" VK_VARIANT_REG_STR "\\ImplicitLayers"
+#define VK_SETTINGS_INFO_REGISTRY_LOC "SOFTWARE\\Khronos\\Vulkan" VK_VARIANT_REG_STR "\\LoaderSettings"
+
struct RegistryEntry {
RegistryEntry() = default;
RegistryEntry(std::string const& name) noexcept : name(name) {}
auto *reg_info = reinterpret_cast<LoaderQueryRegistryInfo *>(query_info->private_data);
std::vector<std::wstring> *paths = nullptr;
- if (reg_info->value_name[6] == L'D') { // looking for drivers
+ if (wcsstr(reg_info->value_name, L"DriverName") != nullptr) { // looking for drivers
paths = &adapter.driver_paths;
- } else if (reg_info->value_name[6] == L'I') { // looking for implicit layers
+ } else if (wcsstr(reg_info->value_name, L"ImplicitLayers") != nullptr) { // looking for implicit layers
paths = &adapter.implicit_layer_paths;
- } else if (reg_info->value_name[6] == L'E') { // looking for explicit layers
+ } else if (wcsstr(reg_info->value_name, L"ExplicitLayers") != nullptr) { // looking for explicit layers
paths = &adapter.explicit_layer_paths;
}
return nullptr;
}
std::vector<RegistryEntry> *get_registry_vector(std::string const &path) {
- if (path == "HKEY_LOCAL_MACHINE\\SOFTWARE\\Khronos\\Vulkan\\Drivers") return &platform_shim.hkey_local_machine_drivers;
- if (path == "HKEY_LOCAL_MACHINE\\SOFTWARE\\Khronos\\Vulkan\\ExplicitLayers")
- return &platform_shim.hkey_local_machine_explicit_layers;
- if (path == "HKEY_LOCAL_MACHINE\\SOFTWARE\\Khronos\\Vulkan\\ImplicitLayers")
- return &platform_shim.hkey_local_machine_implicit_layers;
- if (path == "HKEY_CURRENT_USER\\SOFTWARE\\Khronos\\Vulkan\\ExplicitLayers")
- return &platform_shim.hkey_current_user_explicit_layers;
- if (path == "HKEY_CURRENT_USER\\SOFTWARE\\Khronos\\Vulkan\\ImplicitLayers")
- return &platform_shim.hkey_current_user_implicit_layers;
- if (path == "HKEY_LOCAL_MACHINE\\SOFTWARE\\Khronos\\Vulkan\\LoaderSettings") return &platform_shim.hkey_local_machine_settings;
- if (path == "HKEY_CURRENT_USER\\SOFTWARE\\Khronos\\Vulkan\\LoaderSettings") return &platform_shim.hkey_current_user_settings;
+ if (path == "HKEY_LOCAL_MACHINE\\" VK_DRIVERS_INFO_REGISTRY_LOC) return &platform_shim.hkey_local_machine_drivers;
+ if (path == "HKEY_LOCAL_MACHINE\\" VK_ELAYERS_INFO_REGISTRY_LOC) return &platform_shim.hkey_local_machine_explicit_layers;
+ if (path == "HKEY_LOCAL_MACHINE\\" VK_ILAYERS_INFO_REGISTRY_LOC) return &platform_shim.hkey_local_machine_implicit_layers;
+ if (path == "HKEY_CURRENT_USER\\" VK_ELAYERS_INFO_REGISTRY_LOC) return &platform_shim.hkey_current_user_explicit_layers;
+ if (path == "HKEY_CURRENT_USER\\" VK_ILAYERS_INFO_REGISTRY_LOC) return &platform_shim.hkey_current_user_implicit_layers;
+ if (path == "HKEY_LOCAL_MACHINE\\" VK_SETTINGS_INFO_REGISTRY_LOC) return &platform_shim.hkey_local_machine_settings;
+ if (path == "HKEY_CURRENT_USER\\" VK_SETTINGS_INFO_REGISTRY_LOC) return &platform_shim.hkey_current_user_settings;
return nullptr;
}
LSTATUS __stdcall ShimRegQueryValueExA(HKEY, LPCSTR, LPDWORD, LPDWORD, LPBYTE, LPDWORD) {
auto bad_physical_dev = get_bad_handle<VkPhysicalDevice>();
- VkPhysicalDeviceExternalSemaphoreInfoKHR info = {};
+ VkPhysicalDeviceExternalSemaphoreInfo info = {};
info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO;
info.pNext = nullptr;
VkExternalSemaphoreProperties props = {};
* Copyright (c) 2021-2023 The Khronos Group Inc.
* Copyright (c) 2021-2023 Valve Corporation
* Copyright (c) 2021-2023 LunarG, Inc.
+ * Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * Copyright (c) 2023-2023 RasterGrid Kft.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and/or associated documentation files (the "Materials"), to
ASSERT_EQ(true, found[dev]);
}
for (auto& group : group_props) {
- VkDeviceGroupDeviceCreateInfoKHR group_info{};
+ VkDeviceGroupDeviceCreateInfo group_info{};
group_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO;
group_info.physicalDeviceCount = group.physicalDeviceCount;
group_info.pPhysicalDevices = &group.physicalDevices[0];
const VkBaseInStructure* pNext = reinterpret_cast<const VkBaseInStructure*>(dev.create_info.dev.pNext);
while (pNext != nullptr) {
if (pNext->sType == VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO) {
- ASSERT_EQ(&group_info, reinterpret_cast<const VkDeviceGroupDeviceCreateInfoKHR*>(pNext));
+ ASSERT_EQ(&group_info, reinterpret_cast<const VkDeviceGroupDeviceCreateInfo*>(pNext));
}
if (pNext->sType == 100000) {
ASSERT_EQ(&spacer_structure, pNext);
uint32_t group_count = static_cast<uint32_t>(driver.physical_device_groups.size());
uint32_t returned_group_count = group_count;
- std::vector<VkPhysicalDeviceGroupPropertiesKHR> group_props{};
- group_props.resize(group_count, VkPhysicalDeviceGroupPropertiesKHR{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR});
+ std::vector<VkPhysicalDeviceGroupProperties> group_props{};
+ group_props.resize(group_count, VkPhysicalDeviceGroupProperties{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES});
ASSERT_EQ(VK_SUCCESS, vkEnumeratePhysicalDeviceGroupsKHR(inst, &returned_group_count, group_props.data()));
ASSERT_EQ(group_count, returned_group_count);
ASSERT_EQ(true, found[dev]);
}
for (auto& group : group_props) {
- VkDeviceGroupDeviceCreateInfoKHR group_info{};
+ VkDeviceGroupDeviceCreateInfo group_info{};
group_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO;
group_info.physicalDeviceCount = group.physicalDeviceCount;
group_info.pPhysicalDevices = &group.physicalDevices[0];
ASSERT_EQ(true, found[dev]);
}
for (auto& group : group_props) {
- VkDeviceGroupDeviceCreateInfoKHR group_info{};
+ VkDeviceGroupDeviceCreateInfo group_info{};
group_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO;
group_info.physicalDeviceCount = group.physicalDeviceCount;
group_info.pPhysicalDevices = &group.physicalDevices[0];
ASSERT_EQ(VK_SUCCESS, vkEnumeratePhysicalDeviceGroupsKHR(inst, &returned_group_count, nullptr));
ASSERT_EQ(group_count, returned_group_count);
- std::vector<VkPhysicalDeviceGroupPropertiesKHR> group_props{};
- group_props.resize(group_count, VkPhysicalDeviceGroupPropertiesKHR{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR});
+ std::vector<VkPhysicalDeviceGroupProperties> group_props{};
+ group_props.resize(group_count, VkPhysicalDeviceGroupProperties{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES});
ASSERT_EQ(VK_SUCCESS, vkEnumeratePhysicalDeviceGroupsKHR(inst, &returned_group_count, group_props.data()));
ASSERT_EQ(group_count, returned_group_count);
ASSERT_EQ(true, found[dev]);
}
for (auto& group : group_props) {
- VkDeviceGroupDeviceCreateInfoKHR group_info{};
+ VkDeviceGroupDeviceCreateInfo group_info{};
group_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO;
group_info.physicalDeviceCount = group.physicalDeviceCount;
group_info.pPhysicalDevices = &group.physicalDevices[0];
ASSERT_EQ(true, found);
}
for (auto& group : group_props) {
- VkDeviceGroupDeviceCreateInfoKHR group_info{};
+ VkDeviceGroupDeviceCreateInfo group_info{};
group_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO;
group_info.physicalDeviceCount = group.physicalDeviceCount;
group_info.pPhysicalDevices = &group.physicalDevices[0];
ASSERT_EQ(group_count, returned_group_count);
returned_group_count = 1;
- std::array<VkPhysicalDeviceGroupPropertiesKHR, 1> group_props{};
+ std::array<VkPhysicalDeviceGroupProperties, 1> group_props{};
group_props[0].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES;
ASSERT_EQ(VK_INCOMPLETE, vkEnumeratePhysicalDeviceGroupsKHR(inst, &returned_group_count, group_props.data()));
ASSERT_EQ(1U, returned_group_count);
returned_group_count = 2;
- std::array<VkPhysicalDeviceGroupPropertiesKHR, 2> group_props_2{};
+ std::array<VkPhysicalDeviceGroupProperties, 2> group_props_2{};
group_props_2[0].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES;
group_props_2[1].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES;
ASSERT_EQ(VK_SUCCESS, vkEnumeratePhysicalDeviceGroupsKHR(inst, &returned_group_count, group_props_2.data()));
ASSERT_EQ(true, found);
}
for (auto& group : group_props) {
- VkDeviceGroupDeviceCreateInfoKHR group_info{};
+ VkDeviceGroupDeviceCreateInfo group_info{};
group_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO;
group_info.physicalDeviceCount = group.physicalDeviceCount;
group_info.pPhysicalDevices = &group.physicalDevices[0];
uint32_t core_group_count = 0;
std::vector<VkPhysicalDeviceGroupProperties> core_group_props{};
uint32_t ext_group_count = 0;
- std::vector<VkPhysicalDeviceGroupPropertiesKHR> ext_group_props{};
+ std::vector<VkPhysicalDeviceGroupProperties> ext_group_props{};
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(1, 1, 0);
ASSERT_EQ(ext_group_count, returned_group_count);
ext_group_props.resize(returned_group_count,
- VkPhysicalDeviceGroupPropertiesKHR{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR});
+ VkPhysicalDeviceGroupProperties{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES});
ASSERT_EQ(VK_SUCCESS, vkEnumeratePhysicalDeviceGroupsKHR(inst, &returned_group_count, ext_group_props.data()));
ASSERT_EQ(ext_group_count, returned_group_count);
}
}
for (auto& group : core_group_props) {
- VkDeviceGroupDeviceCreateInfoKHR group_info{};
+ VkDeviceGroupDeviceCreateInfo group_info{};
group_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO;
group_info.physicalDeviceCount = group.physicalDeviceCount;
group_info.pPhysicalDevices = &group.physicalDevices[0];
}
}
for (auto& group : group_props_after) {
- VkDeviceGroupDeviceCreateInfoKHR group_info{};
+ VkDeviceGroupDeviceCreateInfo group_info{};
group_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO;
group_info.physicalDeviceCount = group.physicalDeviceCount;
group_info.pPhysicalDevices = &group.physicalDevices[0];
}
}
for (auto& group : group_props_after) {
- VkDeviceGroupDeviceCreateInfoKHR group_info{};
+ VkDeviceGroupDeviceCreateInfo group_info{};
group_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO;
group_info.physicalDeviceCount = group.physicalDeviceCount;
group_info.pPhysicalDevices = &group.physicalDevices[0];
}
}
for (auto& group : group_props_after) {
- VkDeviceGroupDeviceCreateInfoKHR group_info{};
+ VkDeviceGroupDeviceCreateInfo group_info{};
group_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO;
group_info.physicalDeviceCount = group.physicalDeviceCount;
group_info.pPhysicalDevices = &group.physicalDevices[0];
}
}
for (auto& group : group_props_after) {
- VkDeviceGroupDeviceCreateInfoKHR group_info{};
+ VkDeviceGroupDeviceCreateInfo group_info{};
group_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO;
group_info.physicalDeviceCount = group.physicalDeviceCount;
group_info.pPhysicalDevices = &group.physicalDevices[0];
ASSERT_EQ(group_props_after_add_device[group].physicalDeviceCount, after_add_dev_expected_counts[group]);
}
for (auto& group : group_props_after_add_device) {
- VkDeviceGroupDeviceCreateInfoKHR group_info{};
+ VkDeviceGroupDeviceCreateInfo group_info{};
group_info.sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO;
group_info.physicalDeviceCount = group.physicalDeviceCount;
group_info.pPhysicalDevices = &group.physicalDevices[0];
InstWrapper inst{env.vulkan_functions};
FillDebugUtilsCreateDetails(inst.create_info, env.debug_log);
inst.CheckCreate();
- ASSERT_TRUE(env.debug_log.find(
- std::string("Skipping adding of json file \"") + null_path.str() +
- "\" from registry \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Khronos\\Vulkan\\Drivers\" to the list due to duplication"));
+ ASSERT_TRUE(env.debug_log.find(std::string("Skipping adding of json file \"") + null_path.str() +
+ "\" from registry \"HKEY_LOCAL_MACHINE\\" VK_DRIVERS_INFO_REGISTRY_LOC
+ "\" to the list due to duplication"));
}
#endif