diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 2b9b180..82fa260 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -15194,17 +15194,32 @@ TypeInfo VulkanHppGenerator::readTypeInfo( tinyxml2::XMLElement const * element void VulkanHppGenerator::registerDeleter( std::string const & commandName, CommandData const & commandData ) { - if ( ( commandName.substr( 2, 7 ) == "Destroy" ) || ( commandName.substr( 2, 4 ) == "Free" ) ) + // some special handling for release functions that don't release an object + const std::set noDeleterFunctions = { "vkReleaseFullScreenExclusiveModeEXT", "vkReleaseProfilingLockKHR", "vkReleaseSwapchainImagesEXT" }; + + if ( ( commandName.substr( 2, 7 ) == "Destroy" ) || ( commandName.substr( 2, 4 ) == "Free" ) || + ( ( commandName.substr( 2, 7 ) == "Release" ) && !noDeleterFunctions.contains( commandName ) ) ) { std::string key; size_t valueIndex; switch ( commandData.params.size() ) { case 2: + if ( commandData.params.back().type.type == "VkAllocationCallbacks" ) + { + key = ""; + valueIndex = 0; + } + else + { + key = commandData.params[0].type.type; + valueIndex = 1; + } + break; case 3: assert( commandData.params.back().type.type == "VkAllocationCallbacks" ); - key = ( commandData.params.size() == 2 ) ? "" : commandData.params[0].type.type; - valueIndex = commandData.params.size() - 2; + key = commandData.params[0].type.type; + valueIndex = 1; break; case 4: key = commandData.params[0].type.type; diff --git a/vulkan/vulkan.cppm b/vulkan/vulkan.cppm index 9a2cad5..72e3c74 100644 --- a/vulkan/vulkan.cppm +++ b/vulkan/vulkan.cppm @@ -2874,6 +2874,9 @@ export namespace VULKAN_HPP_NAMESPACE //=== VK_KHR_swapchain === using VULKAN_HPP_NAMESPACE::UniqueSwapchainKHR; + //=== VK_KHR_display === + using VULKAN_HPP_NAMESPACE::UniqueDisplayKHR; + //=== VK_EXT_debug_report === using VULKAN_HPP_NAMESPACE::UniqueDebugReportCallbackEXT; @@ -2897,6 +2900,9 @@ export namespace VULKAN_HPP_NAMESPACE //=== VK_NV_ray_tracing === using VULKAN_HPP_NAMESPACE::UniqueAccelerationStructureNV; + //=== VK_INTEL_performance_query === + using VULKAN_HPP_NAMESPACE::UniquePerformanceConfigurationINTEL; + //=== VK_KHR_deferred_host_operations === using VULKAN_HPP_NAMESPACE::UniqueDeferredOperationKHR; diff --git a/vulkan/vulkan_handles.hpp b/vulkan/vulkan_handles.hpp index 7bcc074..494c767 100644 --- a/vulkan/vulkan_handles.hpp +++ b/vulkan/vulkan_handles.hpp @@ -2095,6 +2095,16 @@ namespace VULKAN_HPP_NAMESPACE using UniqueSwapchainKHR = UniqueHandle; + //=== VK_KHR_display === + template + class UniqueHandleTraits + { + public: + using deleter = ObjectDestroy; + }; + + using UniqueDisplayKHR = UniqueHandle; + //=== VK_EXT_debug_report === template class UniqueHandleTraits @@ -2183,6 +2193,16 @@ namespace VULKAN_HPP_NAMESPACE using UniqueAccelerationStructureNV = UniqueHandle; + //=== VK_INTEL_performance_query === + template + class UniqueHandleTraits + { + public: + using deleter = ObjectDestroy; + }; + + using UniquePerformanceConfigurationINTEL = UniqueHandle; + //=== VK_KHR_deferred_host_operations === template class UniqueHandleTraits diff --git a/vulkan/vulkan_shared.hpp b/vulkan/vulkan_shared.hpp index b3fb82a..74898c8 100644 --- a/vulkan/vulkan_shared.hpp +++ b/vulkan/vulkan_shared.hpp @@ -708,6 +708,17 @@ namespace VULKAN_HPP_NAMESPACE using SharedSwapchainKHR = SharedHandle; + //=== VK_KHR_display === + template <> + class SharedHandleTraits + { + public: + using DestructorType = PhysicalDevice; + using deleter = ObjectDestroyShared; + }; + + using SharedDisplayKHR = SharedHandle; + //=== VK_EXT_debug_report === template <> class SharedHandleTraits @@ -805,6 +816,17 @@ namespace VULKAN_HPP_NAMESPACE using SharedAccelerationStructureNV = SharedHandle; + //=== VK_INTEL_performance_query === + template <> + class SharedHandleTraits + { + public: + using DestructorType = Device; + using deleter = ObjectDestroyShared; + }; + + using SharedPerformanceConfigurationINTEL = SharedHandle; + //=== VK_KHR_deferred_host_operations === template <> class SharedHandleTraits @@ -1015,22 +1037,6 @@ namespace VULKAN_HPP_NAMESPACE //=== VK_KHR_display === - template <> - class SharedHandle : public SharedHandleBaseNoDestroy - { - friend SharedHandleBase; - - public: - SharedHandle() = default; - - explicit SharedHandle( DisplayKHR handle, SharedPhysicalDevice parent ) noexcept - : SharedHandleBaseNoDestroy( handle, std::move( parent ) ) - { - } - }; - - using SharedDisplayKHR = SharedHandle; - template <> class SharedHandle : public SharedHandleBaseNoDestroy { @@ -1046,24 +1052,6 @@ namespace VULKAN_HPP_NAMESPACE }; using SharedDisplayModeKHR = SharedHandle; - - //=== VK_INTEL_performance_query === - - template <> - class SharedHandle : public SharedHandleBaseNoDestroy - { - friend SharedHandleBase; - - public: - SharedHandle() = default; - - explicit SharedHandle( PerformanceConfigurationINTEL handle, SharedDevice parent ) noexcept - : SharedHandleBaseNoDestroy( handle, std::move( parent ) ) - { - } - }; - - using SharedPerformanceConfigurationINTEL = SharedHandle; #endif // !VULKAN_HPP_NO_SMART_HANDLE } // namespace VULKAN_HPP_NAMESPACE #endif // VULKAN_SHARED_HPP diff --git a/vulkan/vulkansc.cppm b/vulkan/vulkansc.cppm index b0e5f2e..5087ac9 100644 --- a/vulkan/vulkansc.cppm +++ b/vulkan/vulkansc.cppm @@ -1347,6 +1347,9 @@ export namespace VULKAN_HPP_NAMESPACE //=== VK_KHR_surface === using VULKAN_HPP_NAMESPACE::UniqueSurfaceKHR; + //=== VK_KHR_display === + using VULKAN_HPP_NAMESPACE::UniqueDisplayKHR; + //=== VK_EXT_debug_utils === using VULKAN_HPP_NAMESPACE::UniqueDebugUtilsMessengerEXT; using VULKAN_HPP_NAMESPACE::UniqueHandleTraits; diff --git a/vulkan/vulkansc_handles.hpp b/vulkan/vulkansc_handles.hpp index 84db90d..374f80c 100644 --- a/vulkan/vulkansc_handles.hpp +++ b/vulkan/vulkansc_handles.hpp @@ -991,6 +991,16 @@ namespace VULKAN_HPP_NAMESPACE using UniqueSurfaceKHR = UniqueHandle; + //=== VK_KHR_display === + template + class UniqueHandleTraits + { + public: + using deleter = ObjectDestroy; + }; + + using UniqueDisplayKHR = UniqueHandle; + //=== VK_EXT_debug_utils === template class UniqueHandleTraits diff --git a/vulkan/vulkansc_shared.hpp b/vulkan/vulkansc_shared.hpp index 61ccc13..46c4b30 100644 --- a/vulkan/vulkansc_shared.hpp +++ b/vulkan/vulkansc_shared.hpp @@ -636,6 +636,17 @@ namespace VULKAN_HPP_NAMESPACE using SharedSurfaceKHR = SharedHandle; + //=== VK_KHR_display === + template <> + class SharedHandleTraits + { + public: + using DestructorType = PhysicalDevice; + using deleter = ObjectDestroyShared; + }; + + using SharedDisplayKHR = SharedHandle; + //=== VK_EXT_debug_utils === template <> class SharedHandleTraits @@ -886,22 +897,6 @@ namespace VULKAN_HPP_NAMESPACE //=== VK_KHR_display === - template <> - class SharedHandle : public SharedHandleBaseNoDestroy - { - friend SharedHandleBase; - - public: - SharedHandle() = default; - - explicit SharedHandle( DisplayKHR handle, SharedPhysicalDevice parent ) noexcept - : SharedHandleBaseNoDestroy( handle, std::move( parent ) ) - { - } - }; - - using SharedDisplayKHR = SharedHandle; - template <> class SharedHandle : public SharedHandleBaseNoDestroy {