Compare commits

...

3 Commits

Author SHA1 Message Date
Andreas Süßenbach 9747e68285
Restrict template argument Dispatch to only take evaluate the newly introduced type trait isDispatchLoader with value == true. (#2360)
Set Version Tag / set-version-tag (push) Has been cancelled Details
2025-11-12 18:21:31 +01:00
Jan Kuhlmann 7c480ca5aa
C++Module: Fix GCC error and replace `std.compat` with `std` (#2353)
* iunclude vulkan.h before the import

* replace std.compat with std
2025-11-12 13:49:10 +01:00
Andreas Süßenbach 5cd5bcf6de
Extent function call tests with Fence commands (#2359) 2025-11-12 13:42:37 +01:00
12 changed files with 4344 additions and 3612 deletions

View File

@ -1710,7 +1710,7 @@ void VulkanHppGenerator::extendSpecialCommands( std::string const & name, bool d
cmd.insert(
pos,
R"( // wrapper function for command vkSetDebugUtilsObjectNameEXT, see https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectNameEXT.html
template <typename HandleType, typename Dispatch>
template <typename HandleType, typename Dispatch, typename std::enable_if<detail::isDispatchLoader<Dispatch>::value, bool>::type>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
Device::setDebugUtilsObjectNameEXT( HandleType const & handle, std::string const & name, Dispatch const & d ) const
{
@ -1728,7 +1728,7 @@ void VulkanHppGenerator::extendSpecialCommands( std::string const & name, bool d
{
cmd.insert( pos, R"( // wrapper function for command vkSetDebugUtilsObjectNameEXT, see
// https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectNameEXT.html
template <typename HandleType, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
template <typename HandleType, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, typename std::enable_if<detail::isDispatchLoader<Dispatch>::value, bool>::type = true>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<void>::type
setDebugUtilsObjectNameEXT( HandleType const & handle, std::string const & name, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
)" );
@ -1781,7 +1781,7 @@ void VulkanHppGenerator::extendSpecialCommands( std::string const & name, bool d
cmd.insert(
pos,
R"( // wrapper function for command vkSetDebugUtilsObjectTagEXT, see https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectTagEXT.html
template <typename HandleType, typename TagType, typename Dispatch>
template <typename HandleType, typename TagType, typename Dispatch, typename std::enable_if<detail::isDispatchLoader<Dispatch>::value, bool>::type>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType<void>::type
Device::setDebugUtilsObjectTagEXT( HandleType const & handle, uint64_t name, TagType const & tag, Dispatch const & d ) const
{
@ -1801,7 +1801,7 @@ void VulkanHppGenerator::extendSpecialCommands( std::string const & name, bool d
{
cmd.insert( pos, R"( // wrapper function for command vkSetDebugUtilsObjectTagEXT, see
// https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectTagEXT.html
template <typename HandleType, typename TagType, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
template <typename HandleType, typename TagType, typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, typename std::enable_if<detail::isDispatchLoader<Dispatch>::value, bool>::type = true>
VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType<void>::type setDebugUtilsObjectTagEXT(
HandleType const & handle, uint64_t name, TagType const & tag, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
)" );
@ -3293,7 +3293,7 @@ std::string VulkanHppGenerator::generateCommandEnhanced( std::string const &
std::string const functionTemplate =
R"( // wrapper function for command ${vkCommandName}, see https://registry.khronos.org/vulkan/specs/latest/man/html/${vkCommandName}.html
template <${argumentTemplates}${allocatorTemplates}typename Dispatch${uniqueHandleAllocatorTemplates}${typenameCheck}>
template <${argumentTemplates}${allocatorTemplates}typename Dispatch${uniqueHandleAllocatorTemplates}${typenameCheck}, typename std::enable_if<detail::isDispatchLoader<Dispatch>::value, bool>::type>
${nodiscard}VULKAN_HPP_INLINE ${decoratedReturnType} ${className}${classSeparator}${commandName}( ${argumentList} )${const}${noexcept}
{
VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION );
@ -3336,7 +3336,7 @@ ${vectorSizeCheck}
{
std::string const functionTemplate =
R"( // wrapper function for command ${vkCommandName}, see https://registry.khronos.org/vulkan/specs/latest/man/html/${vkCommandName}.html
template <${argumentTemplates}${allocatorTemplates}typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE${uniqueHandleAllocatorTemplates}${typenameCheck}>
template <${argumentTemplates}${allocatorTemplates}typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE${uniqueHandleAllocatorTemplates}${typenameCheck}, typename std::enable_if<detail::isDispatchLoader<Dispatch>::value, bool>::type = true>
${nodiscard}${decoratedReturnType} ${commandName}( ${argumentList} )${const}${noexcept};)";
return replaceWithMap( functionTemplate,
@ -4487,7 +4487,7 @@ std::string
std::string const functionTemplate =
R"( // wrapper function for command ${vkCommandName}, see https://registry.khronos.org/vulkan/specs/latest/man/html/${vkCommandName}.html
template <typename Dispatch>
template <typename Dispatch, typename std::enable_if<detail::isDispatchLoader<Dispatch>::value, bool>::type>
${nodiscard}VULKAN_HPP_INLINE ${returnType} ${className}${classSeparator}${commandName}( ${argumentList} )${const} VULKAN_HPP_NOEXCEPT
{
VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION );
@ -4509,7 +4509,7 @@ std::string
{
std::string const functionTemplate =
R"( // wrapper function for command ${vkCommandName}, see https://registry.khronos.org/vulkan/specs/latest/man/html/${vkCommandName}.html
template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
template <typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, typename std::enable_if<detail::isDispatchLoader<Dispatch>::value, bool>::type = true>
${nodiscard}${returnType} ${commandName}( ${argumentList} VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )${const} VULKAN_HPP_NOEXCEPT;)";
return replaceWithMap( functionTemplate,
@ -5509,6 +5509,7 @@ std::string VulkanHppGenerator::generateCppModuleUsings() const
#endif /*VK_NO_PROTOTYPES*/
using VULKAN_HPP_NAMESPACE::detail::createResultValueType;
using VULKAN_HPP_NAMESPACE::detail::resultCheck;
using VULKAN_HPP_NAMESAPCE::detail::isDispatchLoader;
}
#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
namespace VULKAN_HPP_RAII_NAMESPACE
@ -6799,7 +6800,14 @@ ${deviceCommandAssignments}
static DynamicLoader dl;
init(instance, device, dl);
}
};)";
};
template <>
struct isDispatchLoader<DispatchLoaderDynamic>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true;
};
)";
std::string commandMembers, deviceCommandAssignments, initialCommandAssignments, instanceCommandAssignments;
std::set<std::string> listedCommands; // some commands are listed with more than one extension!
@ -6902,6 +6910,12 @@ std::string VulkanHppGenerator::generateDispatchLoaderStatic() const
${commands}
};
template <>
struct isDispatchLoader<DispatchLoaderStatic>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true;
};
inline DispatchLoaderStatic & getDispatchLoaderStatic()
{
static DispatchLoaderStatic dls;

View File

@ -24,7 +24,7 @@ module;
#include <vulkan/${api}_shared.hpp>
export module ${api}_hpp;
export import std.compat;
export import std;
export namespace VULKAN_HPP_NAMESPACE
{

View File

@ -20,3 +20,10 @@
bool m_valid = true;
#endif
};
template <typename Type>
struct isDispatchLoader
{
static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = false;
};

View File

@ -317,13 +317,12 @@ namespace VULKAN_HPP_NAMESPACE
# pragma clang diagnostic ignored "-Wcast-function-type"
# endif
template <typename HandleType>
template <typename HandleType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class ObjectDestroyShared
{
public:
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
template <class Dispatcher>
using DestroyFunctionPointerType =
typename std::conditional<HasDestructor<HandleType>::value,
void ( DestructorType::* )( HandleType, const AllocationCallbacks *, const Dispatcher & ) const,
@ -331,10 +330,9 @@ namespace VULKAN_HPP_NAMESPACE
using SelectorType = typename std::conditional<HasDestructor<HandleType>::value, DestructorType, HandleType>::type;
template <typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
ObjectDestroyShared( Optional<const AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ASSIGNMENT( nullptr ),
const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &SelectorType::destroy ) ) )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType>( &SelectorType::destroy ) ) )
, m_dispatch( &dispatch )
, m_allocationCallbacks( allocationCallbacks )
{
@ -356,24 +354,22 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
DestroyFunctionPointerType m_destroy = nullptr;
const Dispatcher * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
};
template <typename HandleType>
template <typename HandleType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class ObjectFreeShared
{
public:
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
template <class Dispatcher>
using DestroyFunctionPointerType = void ( DestructorType::* )( HandleType, const AllocationCallbacks *, const Dispatcher & ) const;
template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
ObjectFreeShared( Optional<const AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ASSIGNMENT( nullptr ),
const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &DestructorType::free ) ) )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType>( &DestructorType::free ) ) )
, m_dispatch( &dispatch )
, m_allocationCallbacks( allocationCallbacks )
{
@ -387,23 +383,21 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
DestroyFunctionPointerType m_destroy = nullptr;
const Dispatcher * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
};
template <typename HandleType>
template <typename HandleType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class ObjectReleaseShared
{
public:
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
template <class Dispatcher>
using DestroyFunctionPointerType = void ( DestructorType::* )( HandleType, const Dispatcher & ) const;
template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
ObjectReleaseShared( const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &DestructorType::release ) ) )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType>( &DestructorType::release ) ) )
, m_dispatch( &dispatch )
{
}
@ -416,11 +410,11 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
DestroyFunctionPointerType m_destroy = nullptr;
const Dispatcher * m_dispatch = nullptr;
};
template <typename HandleType, typename PoolType>
template <typename HandleType, typename PoolType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class PoolFreeShared
{
public:
@ -428,17 +422,14 @@ namespace VULKAN_HPP_NAMESPACE
using PoolTypeExport = PoolType;
template <class Dispatcher>
using ReturnType = decltype( std::declval<DestructorType>().free( PoolType(), 0u, nullptr, Dispatcher() ) );
template <class Dispatcher>
using DestroyFunctionPointerType = ReturnType<Dispatcher> ( DestructorType::* )( PoolType, uint32_t, const HandleType *, const Dispatcher & ) const;
using DestroyFunctionPointerType = ReturnType( DestructorType::* )( PoolType, uint32_t, const HandleType *, const Dispatcher & ) const;
PoolFreeShared() = default;
template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
PoolFreeShared( SharedHandle<PoolType> pool, const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &DestructorType::free ) ) )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType>( &DestructorType::free ) ) )
, m_dispatch( &dispatch )
, m_pool( std::move( pool ) )
{
@ -452,8 +443,8 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
DestroyFunctionPointerType m_destroy = nullptr;
const Dispatcher * m_dispatch = nullptr;
SharedHandle<PoolType> m_pool{};
};

View File

@ -1,3 +1,4 @@
#include <vulkan/${vulkan_h}>
#if !defined( VULKAN_HPP_CXX_MODULE )
// clang-format off
# include <vulkan/vulkan_hpp_macros.hpp>
@ -27,9 +28,8 @@
#else
# include <cassert>
# include <cstring>
import std.compat;
import std;
#endif
#include <vulkan/${vulkan_h}>
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1
# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ )

View File

@ -504,6 +504,66 @@ int main( int /*argc*/, char ** /*argv*/ )
queue.bindSparse( bindSparseInfo, fence );
}
// Fence commands
{
vk::Device device;
vk::FenceCreateInfo fenceCreateInfo;
vk::AllocationCallbacks allocationCallbacks;
vk::Fence fence;
vk::Result result = device.createFence( &fenceCreateInfo, &allocationCallbacks, &fence );
}
{
vk::Device device;
vk::FenceCreateInfo fenceCreateInfo;
vk::Fence fence = device.createFence( fenceCreateInfo );
}
{
vk::Device device;
vk::Fence fence;
vk::AllocationCallbacks allocationCallbacks;
device.destroyFence( fence, &allocationCallbacks );
}
{
vk::Device device;
vk::Fence fence;
device.destroyFence( fence );
}
{
vk::Device device;
uint32_t fenceCount = 1;
vk::Fence fence;
vk::Result result = device.resetFences( fenceCount, &fence );
}
{
vk::Device device;
vk::Fence fence;
device.resetFences( fence );
}
{
vk::Device device;
vk::Fence fence;
vk::Result result = device.getFenceStatus( fence );
}
{
vk::Device device;
uint32_t fenceCount = 1;
vk::Fence fence;
vk::Bool32 waitAll = vk::True;
uint64_t timeout = 1000000000;
vk::Result result = device.waitForFences( fenceCount, &fence, waitAll, timeout );
}
{
vk::Device device;
vk::Fence fence;
vk::Bool32 waitAll = vk::True;
uint64_t timeout = 1000000000;
vk::Result result = device.waitForFences( fence, waitAll, timeout );
}
#if 0
{
vk::PhysicalDevice physicalDevice;

View File

@ -106,6 +106,11 @@ int main( int /*argc*/, char ** /*argv*/ )
vk::DeviceCreateInfo deviceCreateInfo;
vk::raii::Device device = physicalDevice.createDevice( deviceCreateInfo );
}
{
vk::raii::PhysicalDevice physicalDevice = nullptr;
vk::DeviceCreateInfo deviceCreateInfo;
vk::raii::Device device( physicalDevice, deviceCreateInfo );
}
// Extension discovery commands
{
@ -136,6 +141,12 @@ int main( int /*argc*/, char ** /*argv*/ )
uint32_t queueIndex = 0;
vk::raii::Queue queue = device.getQueue( queueFamilyIndex, queueIndex );
}
{
vk::raii::Device device = nullptr;
uint32_t queueFamilyIndex = 0;
uint32_t queueIndex = 0;
vk::raii::Queue queue( device, queueFamilyIndex, queueIndex );
}
{
vk::raii::Queue queue = nullptr;
@ -160,6 +171,11 @@ int main( int /*argc*/, char ** /*argv*/ )
vk::MemoryAllocateInfo memoryAllocateInfo;
vk::raii::DeviceMemory deviceMemory = device.allocateMemory( memoryAllocateInfo );
}
{
vk::raii::Device device = nullptr;
vk::MemoryAllocateInfo memoryAllocateInfo;
vk::raii::DeviceMemory deviceMemory( device, memoryAllocateInfo );
}
{
vk::raii::DeviceMemory deviceMemory = nullptr;
@ -240,5 +256,36 @@ int main( int /*argc*/, char ** /*argv*/ )
queue.bindSparse( bindSparseInfo, fence );
}
// Fence commands
{
vk::raii::Device device = nullptr;
vk::FenceCreateInfo fenceCreateInfo;
vk::raii::Fence fence = device.createFence( fenceCreateInfo );
}
{
vk::raii::Device device = nullptr;
vk::FenceCreateInfo fenceCreateInfo;
vk::raii::Fence fence( device, fenceCreateInfo );
}
{
vk::raii::Device device = nullptr;
vk::Fence fence;
device.resetFences( fence );
}
{
vk::raii::Fence fence = nullptr;
vk::Result result = fence.getStatus();
}
{
vk::raii::Device device = nullptr;
vk::Fence fence;
vk::Bool32 waitAll = vk::True;
uint64_t timeout = 1000000000;
vk::Result result = device.waitForFences( fence, waitAll, timeout );
}
return 0;
}

View File

@ -29,7 +29,7 @@ VULKAN_HPP_COMPILE_WARNING( VULKAN_HPP_CXX_MODULE_EXPERIMENTAL_WARNING )
#include <vulkan/vulkan_shared.hpp>
export module vulkan_hpp;
export import std.compat;
export import std;
export namespace VULKAN_HPP_NAMESPACE
{
@ -52,6 +52,7 @@ export namespace VULKAN_HPP_NAMESPACE
using VULKAN_HPP_NAMESPACE::detail::DispatchLoaderStatic;
using VULKAN_HPP_NAMESPACE::detail::getDispatchLoaderStatic;
#endif /*VK_NO_PROTOTYPES*/
using VULKAN_HPP_NAMESAPCE::detail::isDispatchLoader;
using VULKAN_HPP_NAMESPACE::detail::createResultValueType;
using VULKAN_HPP_NAMESPACE::detail::resultCheck;
} // namespace detail

View File

@ -8,6 +8,7 @@
#ifndef VULKAN_HPP
#define VULKAN_HPP
#include <vulkan/vulkan.h>
#if !defined( VULKAN_HPP_CXX_MODULE )
// clang-format off
# include <vulkan/vulkan_hpp_macros.hpp>
@ -37,9 +38,8 @@
#else
# include <cassert>
# include <cstring>
import std.compat;
import std;
#endif
#include <vulkan/vulkan.h>
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1
# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNX__ ) || defined( __Fuchsia__ )
@ -1023,6 +1023,12 @@ namespace VULKAN_HPP_NAMESPACE
#endif
};
template <typename Type>
struct isDispatchLoader
{
static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = false;
};
#if !defined( VK_NO_PROTOTYPES ) || ( defined( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC ) && ( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 0 ) )
class DispatchLoaderStatic : public DispatchLoaderBase
{
@ -6600,6 +6606,12 @@ namespace VULKAN_HPP_NAMESPACE
}
};
template <>
struct isDispatchLoader<DispatchLoaderStatic>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true;
};
inline DispatchLoaderStatic & getDispatchLoaderStatic()
{
static DispatchLoaderStatic dls;
@ -24151,6 +24163,13 @@ namespace VULKAN_HPP_NAMESPACE
init( instance, device, dl );
}
};
template <>
struct isDispatchLoader<DispatchLoaderDynamic>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true;
};
} // namespace detail
} // namespace VULKAN_HPP_NAMESPACE
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -321,13 +321,12 @@ namespace VULKAN_HPP_NAMESPACE
# pragma clang diagnostic ignored "-Wcast-function-type"
# endif
template <typename HandleType>
template <typename HandleType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class ObjectDestroyShared
{
public:
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
template <class Dispatcher>
using DestroyFunctionPointerType =
typename std::conditional<HasDestructor<HandleType>::value,
void ( DestructorType::* )( HandleType, const AllocationCallbacks *, const Dispatcher & ) const,
@ -335,10 +334,9 @@ namespace VULKAN_HPP_NAMESPACE
using SelectorType = typename std::conditional<HasDestructor<HandleType>::value, DestructorType, HandleType>::type;
template <typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
ObjectDestroyShared( Optional<const AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ASSIGNMENT( nullptr ),
const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &SelectorType::destroy ) ) )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType>( &SelectorType::destroy ) ) )
, m_dispatch( &dispatch )
, m_allocationCallbacks( allocationCallbacks )
{
@ -360,24 +358,22 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
DestroyFunctionPointerType m_destroy = nullptr;
const Dispatcher * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
};
template <typename HandleType>
template <typename HandleType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class ObjectFreeShared
{
public:
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
template <class Dispatcher>
using DestroyFunctionPointerType = void ( DestructorType::* )( HandleType, const AllocationCallbacks *, const Dispatcher & ) const;
template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
ObjectFreeShared( Optional<const AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ASSIGNMENT( nullptr ),
const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &DestructorType::free ) ) )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType>( &DestructorType::free ) ) )
, m_dispatch( &dispatch )
, m_allocationCallbacks( allocationCallbacks )
{
@ -391,24 +387,21 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
DestroyFunctionPointerType m_destroy = nullptr;
const Dispatcher * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
};
template <typename HandleType>
template <typename HandleType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class ObjectReleaseShared
{
public:
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
template <class Dispatcher>
using DestroyFunctionPointerType = void ( DestructorType::* )( HandleType, const Dispatcher & ) const;
template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
ObjectReleaseShared( const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &DestructorType::release ) ) )
, m_dispatch( &dispatch )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType>( &DestructorType::release ) ) ), m_dispatch( &dispatch )
{
}
@ -420,11 +413,11 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
DestroyFunctionPointerType m_destroy = nullptr;
const Dispatcher * m_dispatch = nullptr;
};
template <typename HandleType, typename PoolType>
template <typename HandleType, typename PoolType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class PoolFreeShared
{
public:
@ -432,17 +425,14 @@ namespace VULKAN_HPP_NAMESPACE
using PoolTypeExport = PoolType;
template <class Dispatcher>
using ReturnType = decltype( std::declval<DestructorType>().free( PoolType(), 0u, nullptr, Dispatcher() ) );
template <class Dispatcher>
using DestroyFunctionPointerType = ReturnType<Dispatcher> ( DestructorType::* )( PoolType, uint32_t, const HandleType *, const Dispatcher & ) const;
using DestroyFunctionPointerType = ReturnType ( DestructorType::* )( PoolType, uint32_t, const HandleType *, const Dispatcher & ) const;
PoolFreeShared() = default;
template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
PoolFreeShared( SharedHandle<PoolType> pool, const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType<Dispatcher>>( &DestructorType::free ) ) )
: m_destroy( reinterpret_cast<decltype( m_destroy )>( static_cast<DestroyFunctionPointerType>( &DestructorType::free ) ) )
, m_dispatch( &dispatch )
, m_pool( std::move( pool ) )
{
@ -456,8 +446,8 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
DestroyFunctionPointerType m_destroy = nullptr;
const Dispatcher * m_dispatch = nullptr;
SharedHandle<PoolType> m_pool{};
};