diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index a8e3f77..9b7355c 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -4047,8 +4047,13 @@ std::string VulkanHppGenerator::constructCommandResultGetHandleUnique( std::stri std::string objectDeleter, allocator; if ( ( name.find( "Acquire" ) != std::string::npos ) || ( name.find( "Get" ) != std::string::npos ) ) { - assert( ( name == "vkAcquirePerformanceConfigurationINTEL" ) || ( name == "vkGetRandROutputDisplayEXT" ) ); - objectDeleter = "ObjectRelease"; + if( ( name == "vkAcquirePerformanceConfigurationINTEL" ) || ( name == "vkGetRandROutputDisplayEXT" ) ) { + objectDeleter = "ObjectRelease"; + } else if ( (name == "vkAcquireWinrtDisplayNV") || (name == "vkGetWinrtDisplayNV") ) { + objectDeleter = "ObjectReleaseExt"; + } else { + throw std::runtime_error( "Found " + name + " which requires special handling for the object deleter"); + } } else if ( name.find( "Allocate" ) != std::string::npos ) { @@ -10422,6 +10427,36 @@ int main( int argc, char ** argv ) OwnerType m_owner = {}; Dispatch const * m_dispatch = nullptr; }; + + template + class ObjectReleaseExt + { + public: + ObjectReleaseExt() = default; + + ObjectReleaseExt( OwnerType owner, Dispatch const & dispatch = VULKAN_HPP_DEFAULT_DISPATCHER ) VULKAN_HPP_NOEXCEPT + : m_owner( owner ) + , m_dispatch( &dispatch ) + {} + + OwnerType getOwner() const VULKAN_HPP_NOEXCEPT + { + return m_owner; + } + + protected: + template + void destroy( T t ) VULKAN_HPP_NOEXCEPT + { + VULKAN_HPP_ASSERT( m_owner && m_dispatch ); + m_owner.releaseExt( t, *m_dispatch ); + } + + private: + OwnerType m_owner = {}; + Dispatch const * m_dispatch = nullptr; + }; + )"; static const std::string classOptional = R"(