Merge pull request #836 from asuessenbach/ObjectReleaseExt

Remove obsolete helper object ObjectReleaseExt.
This commit is contained in:
Andreas Süßenbach 2020-12-07 16:00:31 +01:00 committed by GitHub
commit 7b5ad9a7d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 70 deletions

View File

@ -4047,12 +4047,14 @@ std::string VulkanHppGenerator::constructCommandResultGetHandleUnique( std::stri
std::string objectDeleter, allocator; std::string objectDeleter, allocator;
if ( ( name.find( "Acquire" ) != std::string::npos ) || ( name.find( "Get" ) != std::string::npos ) ) if ( ( name.find( "Acquire" ) != std::string::npos ) || ( name.find( "Get" ) != std::string::npos ) )
{ {
if( ( name == "vkAcquirePerformanceConfigurationINTEL" ) || ( name == "vkGetRandROutputDisplayEXT" ) ) { if ( ( name == "vkAcquirePerformanceConfigurationINTEL" ) || ( name == "vkGetRandROutputDisplayEXT" ) ||
( name == "vkGetWinrtDisplayNV" ) )
{
objectDeleter = "ObjectRelease"; objectDeleter = "ObjectRelease";
} else if ( (name == "vkAcquireWinrtDisplayNV") || (name == "vkGetWinrtDisplayNV") ) { }
objectDeleter = "ObjectReleaseExt"; else
} else { {
throw std::runtime_error( "Found " + name + " which requires special handling for the object deleter"); throw std::runtime_error( "Found " + name + " which requires special handling for the object deleter" );
} }
} }
else if ( name.find( "Allocate" ) != std::string::npos ) else if ( name.find( "Allocate" ) != std::string::npos )
@ -6628,7 +6630,8 @@ void VulkanHppGenerator::checkCorrectness()
return hd.second.objTypeEnum == objectTypeValue.vulkanValue; return hd.second.objTypeEnum == objectTypeValue.vulkanValue;
} ) != m_handles.end(), } ) != m_handles.end(),
objectTypeValue.xmlLine, objectTypeValue.xmlLine,
"VkObjectType value <" + objectTypeValue.vulkanValue + "> not specified as \"objtypeenum\" for any handle" ); "VkObjectType value <" + objectTypeValue.vulkanValue +
"> not specified as \"objtypeenum\" for any handle" );
} }
} }
@ -10427,36 +10430,6 @@ int main( int argc, char ** argv )
OwnerType m_owner = {}; OwnerType m_owner = {};
Dispatch const * m_dispatch = nullptr; Dispatch const * m_dispatch = nullptr;
}; };
template <typename OwnerType, typename Dispatch>
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 <typename T>
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"( static const std::string classOptional = R"(

View File

@ -5017,35 +5017,6 @@ namespace VULKAN_HPP_NAMESPACE
Dispatch const * m_dispatch = nullptr; Dispatch const * m_dispatch = nullptr;
}; };
template <typename OwnerType, typename Dispatch>
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 <typename T>
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;
};
template <typename OwnerType, typename PoolType, typename Dispatch> template <typename OwnerType, typename PoolType, typename Dispatch>
class PoolFree class PoolFree
{ {