Skip to content

Commit

Permalink
build: Update to header 1.3.269
Browse files Browse the repository at this point in the history
- Update known-good
- Fix hard-coded tag index for getting extension names from vk.xml
- Relax regex for correlating kVulkanObjectType* with
  VK_DEBUG_REPORT_OBJECT_TYPE_* by making the trailing _EXT optional
- Generate source
  • Loading branch information
mikes-lunarg committed Oct 20, 2023
1 parent 131a081 commit 692b6a9
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# ~~~
cmake_minimum_required(VERSION 3.17.2)

project(VULKAN_LOADER VERSION 1.3.268)
project(VULKAN_LOADER VERSION 1.3.269)

add_subdirectory(scripts)

Expand Down
8 changes: 8 additions & 0 deletions loader/generated/vk_layer_dispatch_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,14 @@ typedef struct VkLayerDispatchTable_ {
PFN_vkSetPrivateDataEXT SetPrivateDataEXT;
PFN_vkGetPrivateDataEXT GetPrivateDataEXT;

// ---- VK_NV_cuda_kernel_launch extension commands
PFN_vkCreateCudaModuleNV CreateCudaModuleNV;
PFN_vkGetCudaModuleCacheNV GetCudaModuleCacheNV;
PFN_vkCreateCudaFunctionNV CreateCudaFunctionNV;
PFN_vkDestroyCudaModuleNV DestroyCudaModuleNV;
PFN_vkDestroyCudaFunctionNV DestroyCudaFunctionNV;
PFN_vkCmdCudaLaunchKernelNV CmdCudaLaunchKernelNV;

// ---- VK_EXT_metal_objects extension commands
#if defined(VK_USE_PLATFORM_METAL_EXT)
PFN_vkExportMetalObjectsEXT ExportMetalObjectsEXT;
Expand Down
131 changes: 131 additions & 0 deletions loader/generated/vk_loader_extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,14 @@ VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct lo
table->SetPrivateDataEXT = (PFN_vkSetPrivateDataEXT)gdpa(dev, "vkSetPrivateDataEXT");
table->GetPrivateDataEXT = (PFN_vkGetPrivateDataEXT)gdpa(dev, "vkGetPrivateDataEXT");

// ---- VK_NV_cuda_kernel_launch extension commands
table->CreateCudaModuleNV = (PFN_vkCreateCudaModuleNV)gdpa(dev, "vkCreateCudaModuleNV");
table->GetCudaModuleCacheNV = (PFN_vkGetCudaModuleCacheNV)gdpa(dev, "vkGetCudaModuleCacheNV");
table->CreateCudaFunctionNV = (PFN_vkCreateCudaFunctionNV)gdpa(dev, "vkCreateCudaFunctionNV");
table->DestroyCudaModuleNV = (PFN_vkDestroyCudaModuleNV)gdpa(dev, "vkDestroyCudaModuleNV");
table->DestroyCudaFunctionNV = (PFN_vkDestroyCudaFunctionNV)gdpa(dev, "vkDestroyCudaFunctionNV");
table->CmdCudaLaunchKernelNV = (PFN_vkCmdCudaLaunchKernelNV)gdpa(dev, "vkCmdCudaLaunchKernelNV");

// ---- VK_EXT_metal_objects extension commands
#if defined(VK_USE_PLATFORM_METAL_EXT)
table->ExportMetalObjectsEXT = (PFN_vkExportMetalObjectsEXT)gdpa(dev, "vkExportMetalObjectsEXT");
Expand Down Expand Up @@ -2678,6 +2686,14 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDis
if (!strcmp(name, "SetPrivateDataEXT")) return (void *)table->SetPrivateDataEXT;
if (!strcmp(name, "GetPrivateDataEXT")) return (void *)table->GetPrivateDataEXT;

// ---- VK_NV_cuda_kernel_launch extension commands
if (!strcmp(name, "CreateCudaModuleNV")) return (void *)table->CreateCudaModuleNV;
if (!strcmp(name, "GetCudaModuleCacheNV")) return (void *)table->GetCudaModuleCacheNV;
if (!strcmp(name, "CreateCudaFunctionNV")) return (void *)table->CreateCudaFunctionNV;
if (!strcmp(name, "DestroyCudaModuleNV")) return (void *)table->DestroyCudaModuleNV;
if (!strcmp(name, "DestroyCudaFunctionNV")) return (void *)table->DestroyCudaFunctionNV;
if (!strcmp(name, "CmdCudaLaunchKernelNV")) return (void *)table->CmdCudaLaunchKernelNV;

// ---- VK_EXT_metal_objects extension commands
#if defined(VK_USE_PLATFORM_METAL_EXT)
if (!strcmp(name, "ExportMetalObjectsEXT")) return (void *)table->ExportMetalObjectsEXT;
Expand Down Expand Up @@ -7283,6 +7299,95 @@ VKAPI_ATTR void VKAPI_CALL GetPrivateDataEXT(
}


// ---- VK_NV_cuda_kernel_launch extension trampoline/terminators

VKAPI_ATTR VkResult VKAPI_CALL CreateCudaModuleNV(
VkDevice device,
const VkCudaModuleCreateInfoNV* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkCudaModuleNV* pModule) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCreateCudaModuleNV: Invalid device "
"[VUID-vkCreateCudaModuleNV-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
return disp->CreateCudaModuleNV(device, pCreateInfo, pAllocator, pModule);
}

VKAPI_ATTR VkResult VKAPI_CALL GetCudaModuleCacheNV(
VkDevice device,
VkCudaModuleNV module,
size_t* pCacheSize,
void* pCacheData) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkGetCudaModuleCacheNV: Invalid device "
"[VUID-vkGetCudaModuleCacheNV-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
return disp->GetCudaModuleCacheNV(device, module, pCacheSize, pCacheData);
}

VKAPI_ATTR VkResult VKAPI_CALL CreateCudaFunctionNV(
VkDevice device,
const VkCudaFunctionCreateInfoNV* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkCudaFunctionNV* pFunction) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCreateCudaFunctionNV: Invalid device "
"[VUID-vkCreateCudaFunctionNV-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
return disp->CreateCudaFunctionNV(device, pCreateInfo, pAllocator, pFunction);
}

VKAPI_ATTR void VKAPI_CALL DestroyCudaModuleNV(
VkDevice device,
VkCudaModuleNV module,
const VkAllocationCallbacks* pAllocator) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkDestroyCudaModuleNV: Invalid device "
"[VUID-vkDestroyCudaModuleNV-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->DestroyCudaModuleNV(device, module, pAllocator);
}

VKAPI_ATTR void VKAPI_CALL DestroyCudaFunctionNV(
VkDevice device,
VkCudaFunctionNV function,
const VkAllocationCallbacks* pAllocator) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkDestroyCudaFunctionNV: Invalid device "
"[VUID-vkDestroyCudaFunctionNV-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->DestroyCudaFunctionNV(device, function, pAllocator);
}

VKAPI_ATTR void VKAPI_CALL CmdCudaLaunchKernelNV(
VkCommandBuffer commandBuffer,
const VkCudaLaunchInfoNV* pLaunchInfo) {
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCmdCudaLaunchKernelNV: Invalid commandBuffer "
"[VUID-vkCmdCudaLaunchKernelNV-commandBuffer-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->CmdCudaLaunchKernelNV(commandBuffer, pLaunchInfo);
}


// ---- VK_EXT_metal_objects extension trampoline/terminators

#if defined(VK_USE_PLATFORM_METAL_EXT)
Expand Down Expand Up @@ -10769,6 +10874,32 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na
return true;
}

// ---- VK_NV_cuda_kernel_launch extension commands
if (!strcmp("vkCreateCudaModuleNV", name)) {
*addr = (void *)CreateCudaModuleNV;
return true;
}
if (!strcmp("vkGetCudaModuleCacheNV", name)) {
*addr = (void *)GetCudaModuleCacheNV;
return true;
}
if (!strcmp("vkCreateCudaFunctionNV", name)) {
*addr = (void *)CreateCudaFunctionNV;
return true;
}
if (!strcmp("vkDestroyCudaModuleNV", name)) {
*addr = (void *)DestroyCudaModuleNV;
return true;
}
if (!strcmp("vkDestroyCudaFunctionNV", name)) {
*addr = (void *)DestroyCudaFunctionNV;
return true;
}
if (!strcmp("vkCmdCudaLaunchKernelNV", name)) {
*addr = (void *)CmdCudaLaunchKernelNV;
return true;
}

// ---- VK_EXT_metal_objects extension commands
#if defined(VK_USE_PLATFORM_METAL_EXT)
if (!strcmp("vkExportMetalObjectsEXT", name)) {
Expand Down
20 changes: 14 additions & 6 deletions loader/generated/vk_object_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ typedef enum VulkanObjectType {
kVulkanObjectTypeAccelerationStructureNV = 41,
kVulkanObjectTypePerformanceConfigurationINTEL = 42,
kVulkanObjectTypeIndirectCommandsLayoutNV = 43,
kVulkanObjectTypeAccelerationStructureKHR = 44,
kVulkanObjectTypeBufferCollectionFUCHSIA = 45,
kVulkanObjectTypeMicromapEXT = 46,
kVulkanObjectTypeOpticalFlowSessionNV = 47,
kVulkanObjectTypeShaderEXT = 48,
kVulkanObjectTypeMax = 49,
kVulkanObjectTypeCudaModuleNV = 44,
kVulkanObjectTypeCudaFunctionNV = 45,
kVulkanObjectTypeAccelerationStructureKHR = 46,
kVulkanObjectTypeBufferCollectionFUCHSIA = 47,
kVulkanObjectTypeMicromapEXT = 48,
kVulkanObjectTypeOpticalFlowSessionNV = 49,
kVulkanObjectTypeShaderEXT = 50,
kVulkanObjectTypeMax = 51,
// Aliases for backwards compatibilty of "promoted" types
kVulkanObjectTypeDescriptorUpdateTemplateKHR = kVulkanObjectTypeDescriptorUpdateTemplate,
kVulkanObjectTypeSamplerYcbcrConversionKHR = kVulkanObjectTypeSamplerYcbcrConversion,
Expand Down Expand Up @@ -138,6 +140,8 @@ static const char * const object_string[kVulkanObjectTypeMax] = {
"AccelerationStructureNV",
"PerformanceConfigurationINTEL",
"IndirectCommandsLayoutNV",
"CudaModuleNV",
"CudaFunctionNV",
"AccelerationStructureKHR",
"BufferCollectionFUCHSIA",
"MicromapEXT",
Expand Down Expand Up @@ -191,6 +195,8 @@ const VkDebugReportObjectTypeEXT get_debug_report_enum[] = {
VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT, // kVulkanObjectTypeAccelerationStructureNV
VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypePerformanceConfigurationINTEL
VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypeIndirectCommandsLayoutNV
VK_DEBUG_REPORT_OBJECT_TYPE_CUDA_MODULE_NV, // kVulkanObjectTypeCudaModuleNV
VK_DEBUG_REPORT_OBJECT_TYPE_CUDA_FUNCTION_NV, // kVulkanObjectTypeCudaFunctionNV
VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT, // kVulkanObjectTypeAccelerationStructureKHR
VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT, // kVulkanObjectTypeBufferCollectionFUCHSIA
VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypeMicromapEXT
Expand Down Expand Up @@ -244,6 +250,8 @@ const VkObjectType get_object_type_enum[] = {
VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV, // kVulkanObjectTypeAccelerationStructureNV
VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL, // kVulkanObjectTypePerformanceConfigurationINTEL
VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV, // kVulkanObjectTypeIndirectCommandsLayoutNV
VK_OBJECT_TYPE_CUDA_MODULE_NV, // kVulkanObjectTypeCudaModuleNV
VK_OBJECT_TYPE_CUDA_FUNCTION_NV, // kVulkanObjectTypeCudaFunctionNV
VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR, // kVulkanObjectTypeAccelerationStructureKHR
VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA, // kVulkanObjectTypeBufferCollectionFUCHSIA
VK_OBJECT_TYPE_MICROMAP_EXT, // kVulkanObjectTypeMicromapEXT
Expand Down
4 changes: 2 additions & 2 deletions loader/loader.rc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include "winres.h"

// All set through CMake
#define VER_FILE_VERSION 1, 3, 268, 0
#define VER_FILE_DESCRIPTION_STR "1.3.268.Dev Build"
#define VER_FILE_VERSION 1, 3, 269, 0
#define VER_FILE_DESCRIPTION_STR "1.3.269.Dev Build"
#define VER_FILE_VERSION_STR "Vulkan Loader - Dev Build"
#define VER_COPYRIGHT_STR "Copyright (C) 2015-2023"

Expand Down
7 changes: 2 additions & 5 deletions scripts/helper_file_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,7 @@ def beginFeature(self, interface, emit):
if interface.tag != 'extension':
return
name = self.featureName
nameElem = interface[0][1]
name_define = nameElem.get('name')
if 'EXTENSION_NAME' not in name_define:
print("Error in vk.xml file -- extension name is not available")
name_define = next(enum.get('name') for enum in interface.findall('require/enum') if enum.get('name').endswith('_EXTENSION_NAME'))
requires = interface.get('requires')
if requires is not None:
required_extensions = requires.split(',')
Expand Down Expand Up @@ -426,7 +423,7 @@ def to_key(regex, raw_key): return re.search(regex, raw_key).group(1).lower().re
object_types_header += 'const VkDebugReportObjectTypeEXT get_debug_report_enum[] = {\n'
object_types_header += ' VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypeUnknown\n'

dbg_re = '^VK_DEBUG_REPORT_OBJECT_TYPE_(.*)_EXT$'
dbg_re = '^VK_DEBUG_REPORT_OBJECT_TYPE_(.*?)(_EXT)?$'
dbg_map = {to_key(dbg_re, dbg) : dbg for dbg in self.debug_report_object_types}
dbg_default = 'VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT'
for object_type in type_list:
Expand Down
2 changes: 1 addition & 1 deletion scripts/known_good.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"sub_dir": "Vulkan-Headers",
"build_dir": "Vulkan-Headers/build",
"install_dir": "Vulkan-Headers/build/install",
"commit": "v1.3.268"
"commit": "v1.3.269"
},
{
"name": "googletest",
Expand Down

0 comments on commit 692b6a9

Please sign in to comment.