From ce2d68b24b66a91ed798d870ca205f899ee6e79d Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Mon, 26 Aug 2024 23:44:10 -0500 Subject: [PATCH] Update Vulkan-Loader to 1.4 --- CMakeLists.txt | 2 +- loader/generated/vk_layer_dispatch_table.h | 21 ++ loader/generated/vk_loader_extensions.c | 137 ++++++++++-- loader/gpa_helper.c | 27 ++- loader/loader.rc | 4 +- loader/trampoline.c | 239 +++++++++++++++++++++ loader/vulkan-1.def | 28 ++- scripts/known_good.json | 4 +- scripts/loader_extension_generator.py | 2 +- 9 files changed, 432 insertions(+), 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57f8e8eed..05936bd1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ # ~~~ cmake_minimum_required(VERSION 3.17.2) -project(VULKAN_LOADER VERSION 1.3.302 LANGUAGES C) +project(VULKAN_LOADER VERSION 1.4.303 LANGUAGES C) option(CODE_COVERAGE "Enable Code Coverage" OFF) if (CODE_COVERAGE) diff --git a/loader/generated/vk_layer_dispatch_table.h b/loader/generated/vk_layer_dispatch_table.h index 1623326f3..b85e22a55 100644 --- a/loader/generated/vk_layer_dispatch_table.h +++ b/loader/generated/vk_layer_dispatch_table.h @@ -494,6 +494,27 @@ typedef struct VkLayerDispatchTable_ { PFN_vkGetDeviceImageMemoryRequirements GetDeviceImageMemoryRequirements; PFN_vkGetDeviceImageSparseMemoryRequirements GetDeviceImageSparseMemoryRequirements; + // ---- Core Vulkan 1.4 commands + PFN_vkCmdSetLineStipple CmdSetLineStipple; + PFN_vkMapMemory2 MapMemory2; + PFN_vkUnmapMemory2 UnmapMemory2; + PFN_vkCmdBindIndexBuffer2 CmdBindIndexBuffer2; + PFN_vkGetRenderingAreaGranularity GetRenderingAreaGranularity; + PFN_vkGetDeviceImageSubresourceLayout GetDeviceImageSubresourceLayout; + PFN_vkGetImageSubresourceLayout2 GetImageSubresourceLayout2; + PFN_vkCmdPushDescriptorSet CmdPushDescriptorSet; + PFN_vkCmdPushDescriptorSetWithTemplate CmdPushDescriptorSetWithTemplate; + PFN_vkCmdSetRenderingAttachmentLocations CmdSetRenderingAttachmentLocations; + PFN_vkCmdSetRenderingInputAttachmentIndices CmdSetRenderingInputAttachmentIndices; + PFN_vkCmdBindDescriptorSets2 CmdBindDescriptorSets2; + PFN_vkCmdPushConstants2 CmdPushConstants2; + PFN_vkCmdPushDescriptorSet2 CmdPushDescriptorSet2; + PFN_vkCmdPushDescriptorSetWithTemplate2 CmdPushDescriptorSetWithTemplate2; + PFN_vkCopyMemoryToImage CopyMemoryToImage; + PFN_vkCopyImageToMemory CopyImageToMemory; + PFN_vkCopyImageToImage CopyImageToImage; + PFN_vkTransitionImageLayout TransitionImageLayout; + // ---- VK_KHR_swapchain extension commands PFN_vkCreateSwapchainKHR CreateSwapchainKHR; PFN_vkDestroySwapchainKHR DestroySwapchainKHR; diff --git a/loader/generated/vk_loader_extensions.c b/loader/generated/vk_loader_extensions.c index 2be9ab370..542beef7e 100644 --- a/loader/generated/vk_loader_extensions.c +++ b/loader/generated/vk_loader_extensions.c @@ -521,6 +521,27 @@ VKAPI_ATTR void VKAPI_CALL loader_init_device_dispatch_table(struct loader_dev_d table->GetDeviceBufferMemoryRequirements = (PFN_vkGetDeviceBufferMemoryRequirements)gpa(dev, "vkGetDeviceBufferMemoryRequirements"); table->GetDeviceImageMemoryRequirements = (PFN_vkGetDeviceImageMemoryRequirements)gpa(dev, "vkGetDeviceImageMemoryRequirements"); table->GetDeviceImageSparseMemoryRequirements = (PFN_vkGetDeviceImageSparseMemoryRequirements)gpa(dev, "vkGetDeviceImageSparseMemoryRequirements"); + + // ---- Core Vulkan 1.4 commands + table->CmdSetLineStipple = (PFN_vkCmdSetLineStipple)gpa(dev, "vkCmdSetLineStipple"); + table->MapMemory2 = (PFN_vkMapMemory2)gpa(dev, "vkMapMemory2"); + table->UnmapMemory2 = (PFN_vkUnmapMemory2)gpa(dev, "vkUnmapMemory2"); + table->CmdBindIndexBuffer2 = (PFN_vkCmdBindIndexBuffer2)gpa(dev, "vkCmdBindIndexBuffer2"); + table->GetRenderingAreaGranularity = (PFN_vkGetRenderingAreaGranularity)gpa(dev, "vkGetRenderingAreaGranularity"); + table->GetDeviceImageSubresourceLayout = (PFN_vkGetDeviceImageSubresourceLayout)gpa(dev, "vkGetDeviceImageSubresourceLayout"); + table->GetImageSubresourceLayout2 = (PFN_vkGetImageSubresourceLayout2)gpa(dev, "vkGetImageSubresourceLayout2"); + table->CmdPushDescriptorSet = (PFN_vkCmdPushDescriptorSet)gpa(dev, "vkCmdPushDescriptorSet"); + table->CmdPushDescriptorSetWithTemplate = (PFN_vkCmdPushDescriptorSetWithTemplate)gpa(dev, "vkCmdPushDescriptorSetWithTemplate"); + table->CmdSetRenderingAttachmentLocations = (PFN_vkCmdSetRenderingAttachmentLocations)gpa(dev, "vkCmdSetRenderingAttachmentLocations"); + table->CmdSetRenderingInputAttachmentIndices = (PFN_vkCmdSetRenderingInputAttachmentIndices)gpa(dev, "vkCmdSetRenderingInputAttachmentIndices"); + table->CmdBindDescriptorSets2 = (PFN_vkCmdBindDescriptorSets2)gpa(dev, "vkCmdBindDescriptorSets2"); + table->CmdPushConstants2 = (PFN_vkCmdPushConstants2)gpa(dev, "vkCmdPushConstants2"); + table->CmdPushDescriptorSet2 = (PFN_vkCmdPushDescriptorSet2)gpa(dev, "vkCmdPushDescriptorSet2"); + table->CmdPushDescriptorSetWithTemplate2 = (PFN_vkCmdPushDescriptorSetWithTemplate2)gpa(dev, "vkCmdPushDescriptorSetWithTemplate2"); + table->CopyMemoryToImage = (PFN_vkCopyMemoryToImage)gpa(dev, "vkCopyMemoryToImage"); + table->CopyImageToMemory = (PFN_vkCopyImageToMemory)gpa(dev, "vkCopyImageToMemory"); + table->CopyImageToImage = (PFN_vkCopyImageToImage)gpa(dev, "vkCopyImageToImage"); + table->TransitionImageLayout = (PFN_vkTransitionImageLayout)gpa(dev, "vkTransitionImageLayout"); } // Init Device function pointer dispatch table with extension commands @@ -2313,6 +2334,84 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDis return (void *)table->GetDeviceImageSparseMemoryRequirements; } + // ---- Core Vulkan 1.4 commands + if (!strcmp(name, "CmdSetLineStipple")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->CmdSetLineStipple; + } + if (!strcmp(name, "MapMemory2")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->MapMemory2; + } + if (!strcmp(name, "UnmapMemory2")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->UnmapMemory2; + } + if (!strcmp(name, "CmdBindIndexBuffer2")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->CmdBindIndexBuffer2; + } + if (!strcmp(name, "GetRenderingAreaGranularity")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->GetRenderingAreaGranularity; + } + if (!strcmp(name, "GetDeviceImageSubresourceLayout")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->GetDeviceImageSubresourceLayout; + } + if (!strcmp(name, "GetImageSubresourceLayout2")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->GetImageSubresourceLayout2; + } + if (!strcmp(name, "CmdPushDescriptorSet")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->CmdPushDescriptorSet; + } + if (!strcmp(name, "CmdPushDescriptorSetWithTemplate")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->CmdPushDescriptorSetWithTemplate; + } + if (!strcmp(name, "CmdSetRenderingAttachmentLocations")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->CmdSetRenderingAttachmentLocations; + } + if (!strcmp(name, "CmdSetRenderingInputAttachmentIndices")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->CmdSetRenderingInputAttachmentIndices; + } + if (!strcmp(name, "CmdBindDescriptorSets2")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->CmdBindDescriptorSets2; + } + if (!strcmp(name, "CmdPushConstants2")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->CmdPushConstants2; + } + if (!strcmp(name, "CmdPushDescriptorSet2")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->CmdPushDescriptorSet2; + } + if (!strcmp(name, "CmdPushDescriptorSetWithTemplate2")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->CmdPushDescriptorSetWithTemplate2; + } + if (!strcmp(name, "CopyMemoryToImage")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->CopyMemoryToImage; + } + if (!strcmp(name, "CopyImageToMemory")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->CopyImageToMemory; + } + if (!strcmp(name, "CopyImageToImage")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->CopyImageToImage; + } + if (!strcmp(name, "TransitionImageLayout")) { + if (dev->should_ignore_device_commands_from_newer_version && api_version < VK_API_VERSION_1_4) return NULL; + return (void *)table->TransitionImageLayout; + } + // ---- VK_KHR_swapchain extension commands if (!strcmp(name, "CreateSwapchainKHR")) return (void *)table->CreateSwapchainKHR; if (!strcmp(name, "DestroySwapchainKHR")) return (void *)table->DestroySwapchainKHR; @@ -4301,7 +4400,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetFragmentShadingRateKHR( VKAPI_ATTR void VKAPI_CALL CmdSetRenderingAttachmentLocationsKHR( VkCommandBuffer commandBuffer, - const VkRenderingAttachmentLocationInfoKHR* pLocationInfo) { + const VkRenderingAttachmentLocationInfo* pLocationInfo) { 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, @@ -4314,7 +4413,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetRenderingAttachmentLocationsKHR( VKAPI_ATTR void VKAPI_CALL CmdSetRenderingInputAttachmentIndicesKHR( VkCommandBuffer commandBuffer, - const VkRenderingInputAttachmentIndexInfoKHR* pInputAttachmentIndexInfo) { + const VkRenderingInputAttachmentIndexInfo* pInputAttachmentIndexInfo) { 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, @@ -4508,7 +4607,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutableInternalRepresentationsKHR( VKAPI_ATTR VkResult VKAPI_CALL MapMemory2KHR( VkDevice device, - const VkMemoryMapInfoKHR* pMemoryMapInfo, + const VkMemoryMapInfo* pMemoryMapInfo, void** ppData) { const VkLayerDispatchTable *disp = loader_get_dispatch(device); if (NULL == disp) { @@ -4522,7 +4621,7 @@ VKAPI_ATTR VkResult VKAPI_CALL MapMemory2KHR( VKAPI_ATTR VkResult VKAPI_CALL UnmapMemory2KHR( VkDevice device, - const VkMemoryUnmapInfoKHR* pMemoryUnmapInfo) { + const VkMemoryUnmapInfo* pMemoryUnmapInfo) { 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, @@ -4848,7 +4947,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindIndexBuffer2KHR( VKAPI_ATTR void VKAPI_CALL GetRenderingAreaGranularityKHR( VkDevice device, - const VkRenderingAreaInfoKHR* pRenderingAreaInfo, + const VkRenderingAreaInfo* pRenderingAreaInfo, VkExtent2D* pGranularity) { const VkLayerDispatchTable *disp = loader_get_dispatch(device); if (NULL == disp) { @@ -4862,8 +4961,8 @@ VKAPI_ATTR void VKAPI_CALL GetRenderingAreaGranularityKHR( VKAPI_ATTR void VKAPI_CALL GetDeviceImageSubresourceLayoutKHR( VkDevice device, - const VkDeviceImageSubresourceInfoKHR* pInfo, - VkSubresourceLayout2KHR* pLayout) { + const VkDeviceImageSubresourceInfo* pInfo, + VkSubresourceLayout2* pLayout) { 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, @@ -4877,8 +4976,8 @@ VKAPI_ATTR void VKAPI_CALL GetDeviceImageSubresourceLayoutKHR( VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout2KHR( VkDevice device, VkImage image, - const VkImageSubresource2KHR* pSubresource, - VkSubresourceLayout2KHR* pLayout) { + const VkImageSubresource2* pSubresource, + VkSubresourceLayout2* pLayout) { 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, @@ -5069,7 +5168,7 @@ VKAPI_ATTR VkResult VKAPI_CALL GetCalibratedTimestampsKHR( VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets2KHR( VkCommandBuffer commandBuffer, - const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo) { + const VkBindDescriptorSetsInfo* pBindDescriptorSetsInfo) { 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, @@ -5082,7 +5181,7 @@ VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets2KHR( VKAPI_ATTR void VKAPI_CALL CmdPushConstants2KHR( VkCommandBuffer commandBuffer, - const VkPushConstantsInfoKHR* pPushConstantsInfo) { + const VkPushConstantsInfo* pPushConstantsInfo) { 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, @@ -5095,7 +5194,7 @@ VKAPI_ATTR void VKAPI_CALL CmdPushConstants2KHR( VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSet2KHR( VkCommandBuffer commandBuffer, - const VkPushDescriptorSetInfoKHR* pPushDescriptorSetInfo) { + const VkPushDescriptorSetInfo* pPushDescriptorSetInfo) { 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, @@ -5108,7 +5207,7 @@ VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSet2KHR( VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplate2KHR( VkCommandBuffer commandBuffer, - const VkPushDescriptorSetWithTemplateInfoKHR* pPushDescriptorSetWithTemplateInfo) { + const VkPushDescriptorSetWithTemplateInfo* pPushDescriptorSetWithTemplateInfo) { 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, @@ -7338,7 +7437,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetStencilOpEXT( VKAPI_ATTR VkResult VKAPI_CALL CopyMemoryToImageEXT( VkDevice device, - const VkCopyMemoryToImageInfoEXT* pCopyMemoryToImageInfo) { + const VkCopyMemoryToImageInfo* pCopyMemoryToImageInfo) { 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, @@ -7351,7 +7450,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CopyMemoryToImageEXT( VKAPI_ATTR VkResult VKAPI_CALL CopyImageToMemoryEXT( VkDevice device, - const VkCopyImageToMemoryInfoEXT* pCopyImageToMemoryInfo) { + const VkCopyImageToMemoryInfo* pCopyImageToMemoryInfo) { 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, @@ -7364,7 +7463,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CopyImageToMemoryEXT( VKAPI_ATTR VkResult VKAPI_CALL CopyImageToImageEXT( VkDevice device, - const VkCopyImageToImageInfoEXT* pCopyImageToImageInfo) { + const VkCopyImageToImageInfo* pCopyImageToImageInfo) { 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, @@ -7378,7 +7477,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CopyImageToImageEXT( VKAPI_ATTR VkResult VKAPI_CALL TransitionImageLayoutEXT( VkDevice device, uint32_t transitionCount, - const VkHostImageLayoutTransitionInfoEXT* pTransitions) { + const VkHostImageLayoutTransitionInfo* pTransitions) { 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, @@ -7392,8 +7491,8 @@ VKAPI_ATTR VkResult VKAPI_CALL TransitionImageLayoutEXT( VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout2EXT( VkDevice device, VkImage image, - const VkImageSubresource2KHR* pSubresource, - VkSubresourceLayout2KHR* pLayout) { + const VkImageSubresource2* pSubresource, + VkSubresourceLayout2* pLayout) { 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, diff --git a/loader/gpa_helper.c b/loader/gpa_helper.c index 8581d0163..09e7ede63 100644 --- a/loader/gpa_helper.c +++ b/loader/gpa_helper.c @@ -1,8 +1,8 @@ /* * - * Copyright (c) 2015-2021 The Khronos Group Inc. - * Copyright (c) 2015-2021 Valve Corporation - * Copyright (c) 2015-2021 LunarG, Inc. + * Copyright (c) 2015-2024 The Khronos Group Inc. + * Copyright (c) 2015-2024 Valve Corporation + * Copyright (c) 2015-2024 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -249,6 +249,27 @@ void *trampoline_get_proc_addr(struct loader_instance *inst, const char *funcNam if (!strcmp(funcName, "vkGetDeviceImageMemoryRequirements")) return vkGetDeviceImageMemoryRequirements; if (!strcmp(funcName, "vkGetDeviceImageSparseMemoryRequirements")) return vkGetDeviceImageSparseMemoryRequirements; + // Core 1.4 functions + if (!strcmp(funcName, "vkCmdSetLineStipple")) return vkCmdSetLineStipple; + if (!strcmp(funcName, "vkMapMemory2")) return vkMapMemory2; + if (!strcmp(funcName, "vkUnmapMemory2")) return vkUnmapMemory2; + if (!strcmp(funcName, "vkCmdBindIndexBuffer2")) return vkCmdBindIndexBuffer2; + if (!strcmp(funcName, "vkGetRenderingAreaGranularity")) return vkGetRenderingAreaGranularity; + if (!strcmp(funcName, "vkGetDeviceImageSubresourceLayout")) return vkGetDeviceImageSubresourceLayout; + if (!strcmp(funcName, "vkGetImageSubresourceLayout2")) return vkGetImageSubresourceLayout2; + if (!strcmp(funcName, "vkCmdPushDescriptorSet")) return vkCmdPushDescriptorSet; + if (!strcmp(funcName, "vkCmdPushDescriptorSetWithTemplate")) return vkCmdPushDescriptorSetWithTemplate; + if (!strcmp(funcName, "vkCmdSetRenderingAttachmentLocations")) return vkCmdSetRenderingAttachmentLocations; + if (!strcmp(funcName, "vkCmdSetRenderingInputAttachmentIndices")) return vkCmdSetRenderingInputAttachmentIndices; + if (!strcmp(funcName, "vkCmdBindDescriptorSets2")) return vkCmdBindDescriptorSets2; + if (!strcmp(funcName, "vkCmdPushConstants2")) return vkCmdPushConstants2; + if (!strcmp(funcName, "vkCmdPushDescriptorSet2")) return vkCmdPushDescriptorSet2; + if (!strcmp(funcName, "vkCmdPushDescriptorSetWithTemplate2")) return vkCmdPushDescriptorSetWithTemplate2; + if (!strcmp(funcName, "vkCopyMemoryToImage")) return vkCopyMemoryToImage; + if (!strcmp(funcName, "vkCopyImageToMemory")) return vkCopyImageToMemory; + if (!strcmp(funcName, "vkCopyImageToImage")) return vkCopyImageToImage; + if (!strcmp(funcName, "vkTransitionImageLayout")) return vkTransitionImageLayout; + // Instance extensions void *addr; if (debug_extensions_InstanceGpa(inst, funcName, &addr)) return addr; diff --git a/loader/loader.rc b/loader/loader.rc index 95e56ab04..763c3640d 100644 --- a/loader/loader.rc +++ b/loader/loader.rc @@ -22,8 +22,8 @@ #include "winres.h" // All set through CMake -#define VER_FILE_VERSION 1, 3, 302, 0 -#define VER_FILE_DESCRIPTION_STR "1.3.302.Dev Build" +#define VER_FILE_VERSION 1, 4, 303, 0 +#define VER_FILE_DESCRIPTION_STR "1.4.303.Dev Build" #define VER_FILE_VERSION_STR "Vulkan Loader - Dev Build" #define VER_COPYRIGHT_STR "Copyright (C) 2015-2024" diff --git a/loader/trampoline.c b/loader/trampoline.c index ad2677f36..143aca4a7 100644 --- a/loader/trampoline.c +++ b/loader/trampoline.c @@ -3586,3 +3586,242 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit2(VkQueue queue, uint3 } return disp->QueueSubmit2(queue, submitCount, pSubmits, fence); } + +// ---- Vulkan core 1.4 trampolines + +// Instance + +// Device + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetRenderingAreaGranularity(VkDevice device, + const VkRenderingAreaInfo *pRenderingAreaInfo, + VkExtent2D *pGranularity) { + 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, + "vkGetRenderingAreaGranularity: Invalid device " + "[VUID-vkGetRenderingAreaGranularity-device-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + disp->GetRenderingAreaGranularity(device, pRenderingAreaInfo, pGranularity); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSet(VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, + uint32_t set, uint32_t descriptorWriteCount, + const VkWriteDescriptorSet *pDescriptorWrites) { + 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, + "vkCmdPushDescriptorSet: Invalid commandBuffer " + "[VUID-vkCmdPushDescriptorSet-commandBuffer-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + disp->CmdPushDescriptorSet(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplate(VkCommandBuffer commandBuffer, + VkDescriptorUpdateTemplate descriptorUpdateTemplate, + VkPipelineLayout layout, uint32_t set, + const void *pData) { + 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, + "vkCmdPushDescriptorSetWithTemplate: Invalid commandBuffer " + "[VUID-vkCmdPushDescriptorSetWithTemplate-commandBuffer-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + disp->CmdPushDescriptorSetWithTemplate(commandBuffer, descriptorUpdateTemplate, layout, set, pData); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, + uint16_t lineStipplePattern) { + 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, + "vkCmdSetLineStipple: Invalid commandBuffer " + "[VUID-vkCmdSetLineStipple-commandBuffer-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + disp->CmdSetLineStipple(commandBuffer, lineStippleFactor, lineStipplePattern); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer2(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, + VkDeviceSize size, VkIndexType indexType) { + 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, + "vkCmdBindIndexBuffer2: Invalid commandBuffer " + "[VUID-vkCmdBindIndexBuffer2-commandBuffer-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + disp->CmdBindIndexBuffer2(commandBuffer, buffer, offset, size, indexType); +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCopyMemoryToImage(VkDevice device, + const VkCopyMemoryToImageInfo *pCopyMemoryToImageInfo) { + 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, + "vkCopyMemoryToImage: Invalid device " + "[VUID-vkCopyMemoryToImage-device-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + return disp->CopyMemoryToImage(device, pCopyMemoryToImageInfo); +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCopyImageToMemory(VkDevice device, + const VkCopyImageToMemoryInfo *pCopyImageToMemoryInfo) { + 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, + "vkCopyImageToMemory: Invalid device " + "[VUID-vkCopyImageToMemory-device-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + return disp->CopyImageToMemory(device, pCopyImageToMemoryInfo); +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCopyImageToImage(VkDevice device, + const VkCopyImageToImageInfo *pCopyImageToImageInfo) { + 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, + "vkCopyImageToImage: Invalid device " + "[VUID-vkCopyImageToImage-device-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + return disp->CopyImageToImage(device, pCopyImageToImageInfo); +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkTransitionImageLayout(VkDevice device, uint32_t transitionCount, + const VkHostImageLayoutTransitionInfo *pTransitions) { + 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, + "vkTransitionImageLayout: Invalid device " + "[VUID-vkTransitionImageLayout-device-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + return disp->TransitionImageLayout(device, transitionCount, pTransitions); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceImageSubresourceLayout(VkDevice device, + const VkDeviceImageSubresourceInfo *pInfo, + VkSubresourceLayout2 *pLayout) { + 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, + "vkGetDeviceImageSubresourceLayout: Invalid device " + "[VUID-vkGetDeviceImageSubresourceLayout-device-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + disp->GetDeviceImageSubresourceLayout(device, pInfo, pLayout); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout2(VkDevice device, VkImage image, + const VkImageSubresource2 *pSubresource, + VkSubresourceLayout2 *pLayout) { + 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, + "vkGetImageSubresourceLayout2: Invalid device " + "[VUID-vkGetImageSubresourceLayout2-device-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + disp->GetImageSubresourceLayout2(device, image, pSubresource, pLayout); +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory2(VkDevice device, const VkMemoryMapInfo *pMemoryMapInfo, void **ppData) { + 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, + "vkMapMemory2: Invalid device " + "[VUID-vkMapMemory2-device-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + return disp->MapMemory2(device, pMemoryMapInfo, ppData); +} + +LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkUnmapMemory2(VkDevice device, const VkMemoryUnmapInfo *pMemoryUnmapInfo) { + 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, + "vkUnmapMemory2: Invalid device " + "[VUID-vkUnmapMemory2-device-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + return disp->UnmapMemory2(device, pMemoryUnmapInfo); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets2(VkCommandBuffer commandBuffer, + const VkBindDescriptorSetsInfo *pBindDescriptorSetsInfo) { + 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, + "vkCmdBindDescriptorSets2: Invalid commandBuffer " + "[VUID-vkCmdBindDescriptorSets2-commandBuffer-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + disp->CmdBindDescriptorSets2(commandBuffer, pBindDescriptorSetsInfo); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants2(VkCommandBuffer commandBuffer, + const VkPushConstantsInfo *pPushConstantsInfo) { + 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, + "vkCmdPushConstants2: Invalid commandBuffer " + "[VUID-vkCmdPushConstants2-commandBuffer-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + disp->CmdPushConstants2(commandBuffer, pPushConstantsInfo); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSet2(VkCommandBuffer commandBuffer, + const VkPushDescriptorSetInfo *pPushDescriptorSetInfo) { + 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, + "vkCmdPushDescriptorSet2: Invalid commandBuffer " + "[VUID-vkCmdPushDescriptorSet2-commandBuffer-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + disp->CmdPushDescriptorSet2(commandBuffer, pPushDescriptorSetInfo); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplate2( + VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo *pPushDescriptorSetWithTemplateInfo) { + 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, + "vkCmdPushDescriptorSetWithTemplate2: Invalid commandBuffer " + "[VUID-vkCmdPushDescriptorSetWithTemplate2-commandBuffer-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + disp->CmdPushDescriptorSetWithTemplate2(commandBuffer, pPushDescriptorSetWithTemplateInfo); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL +vkCmdSetRenderingAttachmentLocations(VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfo *pLocationInfo) { + 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, + "vkCmdSetRenderingAttachmentLocations: Invalid commandBuffer " + "[VUID-vkCmdSetRenderingAttachmentLocations-commandBuffer-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + disp->CmdSetRenderingAttachmentLocations(commandBuffer, pLocationInfo); +} + +LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetRenderingInputAttachmentIndices( + VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo *pInputAttachmentIndexInfo) { + 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, + "vkCmdSetRenderingInputAttachmentIndices: Invalid commandBuffer " + "[VUID-vkCmdSetRenderingInputAttachmentIndices-commandBuffer-parameter]"); + abort(); /* Intentionally fail so user can correct issue. */ + } + disp->CmdSetRenderingInputAttachmentIndices(commandBuffer, pInputAttachmentIndexInfo); +} diff --git a/loader/vulkan-1.def b/loader/vulkan-1.def index f1aab7880..de598bc07 100644 --- a/loader/vulkan-1.def +++ b/loader/vulkan-1.def @@ -1,9 +1,9 @@ ;;;; Begin Copyright Notice ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; -; Copyright (c) 2015-2021 The Khronos Group Inc. -; Copyright (c) 2015-2021 Valve Corporation -; Copyright (c) 2015-2021 LunarG, Inc. +; Copyright (c) 2015-2024 The Khronos Group Inc. +; Copyright (c) 2015-2024 Valve Corporation +; Copyright (c) 2015-2024 LunarG, Inc. ; ; Licensed under the Apache License, Version 2.0 (the "License"); ; you may not use this file except in compliance with the License. @@ -275,4 +275,24 @@ EXPORTS vkCmdSetPrimitiveRestartEnable vkGetDeviceBufferMemoryRequirements vkGetDeviceImageMemoryRequirements - vkGetDeviceImageSparseMemoryRequirements \ No newline at end of file + vkGetDeviceImageSparseMemoryRequirements + + vkCmdSetLineStipple + vkMapMemory2 + vkUnmapMemory2 + vkCmdBindIndexBuffer2 + vkGetRenderingAreaGranularity + vkGetDeviceImageSubresourceLayout + vkGetImageSubresourceLayout2 + vkCmdPushDescriptorSet + vkCmdPushDescriptorSetWithTemplate + vkCmdSetRenderingAttachmentLocations + vkCmdSetRenderingInputAttachmentIndices + vkCmdBindDescriptorSets2 + vkCmdPushConstants2 + vkCmdPushDescriptorSet2 + vkCmdPushDescriptorSetWithTemplate2 + vkCopyMemoryToImage + vkCopyImageToMemory + vkCopyImageToImage + vkTransitionImageLayout diff --git a/scripts/known_good.json b/scripts/known_good.json index a8e2fa4fa..46a080c0b 100644 --- a/scripts/known_good.json +++ b/scripts/known_good.json @@ -7,7 +7,7 @@ "sub_dir": "Vulkan-Headers", "build_dir": "Vulkan-Headers/build", "install_dir": "Vulkan-Headers/build/install", - "commit": "v1.3.302" + "commit": "v1.4.303" }, { "name": "googletest", @@ -42,4 +42,4 @@ "googletest": "GOOGLETEST_INSTALL_DIR", "detours": "DETOURS_INSTALL_DIR" } -} \ No newline at end of file +} diff --git a/scripts/loader_extension_generator.py b/scripts/loader_extension_generator.py index a0b9f69b5..5913c0d4c 100644 --- a/scripts/loader_extension_generator.py +++ b/scripts/loader_extension_generator.py @@ -483,7 +483,7 @@ def getTypeNameTuple(self, param): return (t, n) # Convert an XML dependency expression to a C expression, taking a callback to replace extension names - # See https://registry.khronos.org/vulkan/specs/1.3/registry.html#depends-expressions + # See https://registry.khronos.org/vulkan/specs/1.4/registry.html#depends-expressions @staticmethod def ConvertDependencyExpression(expr, replace_func): # '(' and ')' can pass through unchanged