diff --git a/object.hpp b/object.hpp index 769b34e..29b441f 100644 --- a/object.hpp +++ b/object.hpp @@ -58,7 +58,7 @@ namespace cruft::vk { root (Args &&...args): object ( cruft::vk::error::try_query ( - life_traits>::create, + wrapper_traits::create, std::forward (args)... ) ) @@ -66,7 +66,7 @@ namespace cruft::vk { ~root () { - life_traits>::destroy (this->native (), nullptr); + wrapper_traits::destroy (this->native (), nullptr); } }; @@ -81,7 +81,7 @@ namespace cruft::vk { descendant (ParentT &parent, Args &&...args): object ( cruft::vk::error::try_query( - life_traits>::create, + wrapper_traits::create, parent.native (), std::forward (args)... ) @@ -92,7 +92,7 @@ namespace cruft::vk { //--------------------------------------------------------------------- ~descendant () { - life_traits>::destroy (this->native (), nullptr); + wrapper_traits::destroy (this->native (), nullptr); } }; @@ -129,7 +129,7 @@ namespace cruft::vk { owned (OwnerT &owner, Args &&...args): object ( error::try_query ( - life_traits>::create, + wrapper_traits::create, owner.native (), std::forward (args)... ) @@ -154,7 +154,7 @@ namespace cruft::vk { void destroy (OwnerT &owner) { - life_traits>::destroy (owner.native (), this->native (), nullptr); + wrapper_traits::destroy (owner.native (), this->native (), nullptr); this->m_native = VK_NULL_HANDLE; } }; diff --git a/traits.hpp b/traits.hpp index cbff83e..08f70c5 100644 --- a/traits.hpp +++ b/traits.hpp @@ -170,6 +170,8 @@ namespace cruft::vk { template <> struct owner_traits { using type = device; }; template <> struct owner_traits { using type = instance; }; template <> struct owner_traits { using type = device; }; + template <> struct owner_traits> { using type = device; }; + template <> struct owner_traits> { using type = device; }; template using owner_t = typename owner_traits::type; @@ -314,16 +316,22 @@ namespace cruft::vk { }; + /////////////////////////////////////////////////////////////////////////// + template + struct wrapper_traits : public life_traits> { }; + + //------------------------------------------------------------------------- template <> - struct life_traits> { + struct wrapper_traits> { static constexpr auto &create = vkCreateGraphicsPipelines; static constexpr auto &destroy = vkDestroyPipeline; }; + //------------------------------------------------------------------------- template <> - struct life_traits> { + struct wrapper_traits> { static constexpr auto &create = vkCreateComputePipelines; static constexpr auto &destroy = vkDestroyPipeline; };