Refactor top-level function to generate vulkan.hpp

This commit is contained in:
asuessenbach
2022-07-28 17:09:08 +02:00
parent b95c02b89d
commit 893d6847bb
24 changed files with 2223 additions and 2226 deletions

29
snippets/PoolFree.hpp Normal file
View File

@@ -0,0 +1,29 @@
template <typename OwnerType, typename PoolType, typename Dispatch>
class PoolFree
{
public:
PoolFree() = default;
PoolFree( OwnerType owner,
PoolType pool,
Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT
: m_owner( owner )
, m_pool( pool )
, m_dispatch( &dispatch )
{}
OwnerType getOwner() const VULKAN_HPP_NOEXCEPT { return m_owner; }
PoolType getPool() const VULKAN_HPP_NOEXCEPT { return m_pool; }
protected:
template <typename T>
void destroy(T t) VULKAN_HPP_NOEXCEPT
{
( m_owner.free )( m_pool, t, *m_dispatch );
}
private:
OwnerType m_owner = OwnerType();
PoolType m_pool = PoolType();
Dispatch const * m_dispatch = nullptr;
};