VulkanMemoryAllocator-Hpp
VulkanMemoryAllocator-Hpp copied to clipboard
destroy function overloads.
vulkan-hpp provides destroy function overloads. I'm not sure this makes the API better, but to be on par with the vulkan-hpp API I think they should be there.
Can you elaborate on what you mean by "destroy function overloads"?
If you look at the vulkan-hpp header file, for every destroy*() function (e.g, destroyImage()) there is a function named destroy() that takes as argument the object to destroy (e.g, destroy(vk::Image)), e.i, the destroy() function is overloaded.
The following code sniped shows the declaration of destroyBuffer() with its destroy() overload in vulkan.hpp:
template<typename Dispatch = DispatchLoaderDefault>
void destroyBuffer( Buffer buffer, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template<typename Dispatch = DispatchLoaderDefault>
void destroyBuffer( Buffer buffer, Optional<const AllocationCallbacks> allocator = nullptr, Dispatch const &d = Dispatch() ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
template<typename Dispatch = DispatchLoaderDefault>
void destroy( Buffer buffer, const AllocationCallbacks* pAllocator, Dispatch const &d = Dispatch() ) const;
#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE
template<typename Dispatch = DispatchLoaderDefault>
void destroy( Buffer buffer, Optional<const AllocationCallbacks> allocator = nullptr, Dispatch const &d = Dispatch() ) const;
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
This overloads are also present as member functions of Device and Instance.
I see... Personally I'm not a fan of this kind of function overloading, but for the sake of consistency I'll accept a PR if you'd like to have these functions in the bindings.
I see... Personally I'm not a fan of this kind of function overloading, but for the sake of consistency I'll accept a PR if you'd like to have these functions in the bindings.
Function overloading on object destruction is used for Unique Handle <Type>