Move all the dispatcher related classes into namespace detail (#1983)

This commit is contained in:
Andreas Süßenbach 2024-10-29 08:13:51 +01:00 committed by GitHub
parent 24dee1ce75
commit ed3cf7ac51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 16186 additions and 16039 deletions

View File

@ -458,27 +458,30 @@ ${defines}
namespace VULKAN_HPP_NAMESPACE
{
${ArrayWrapper1D}
${ArrayWrapper2D}
${ArrayWrapper1D}
${ArrayWrapper2D}
#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
${ArrayProxy}
${ArrayProxyNoTemporaries}
${StridedArrayProxy}
${Optional}
${StructureChain}
${UniqueHandle}
${ArrayProxy}
${ArrayProxyNoTemporaries}
${StridedArrayProxy}
${Optional}
${StructureChain}
${UniqueHandle}
#endif // VULKAN_HPP_DISABLE_ENHANCED_MODE
${DispatchLoaderBase}
${DispatchLoaderStatic}
${Exchange}
namespace detail
{
${DispatchLoaderBase}
${DispatchLoaderStatic}
}
${Exchange}
#if !defined( VULKAN_HPP_NO_SMART_HANDLE )
${ObjectDestroy}
${ObjectFree}
${ObjectRelease}
${PoolFree}
${ObjectDestroy}
${ObjectFree}
${ObjectRelease}
${PoolFree}
#endif // !VULKAN_HPP_NO_SMART_HANDLE
${baseTypes}
${baseTypes}
template <typename Type, Type value = Type{}>
struct CppType
@ -522,11 +525,14 @@ ${constexprDefines}
namespace VULKAN_HPP_NAMESPACE
{
#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
${structExtendsStructs}
${structExtendsStructs}
#endif // VULKAN_HPP_DISABLE_ENHANCED_MODE
${DynamicLoader}
${DispatchLoaderDynamic}
namespace detail
{
${DynamicLoader}
${DispatchLoaderDynamic}
}
} // namespace VULKAN_HPP_NAMESPACE
#endif
)";
@ -611,20 +617,26 @@ namespace VULKAN_HPP_NAMESPACE
{
namespace VULKAN_HPP_RAII_NAMESPACE
{
template <class T>
class CreateReturnType
namespace detail
{
public:
template <class T>
class CreateReturnType
{
public:
#if defined( VULKAN_HPP_RAII_NO_EXCEPTIONS )
using Type = VULKAN_HPP_EXPECTED<T, VULKAN_HPP_NAMESPACE::Result>;
using Type = VULKAN_HPP_EXPECTED<T, VULKAN_HPP_NAMESPACE::Result>;
#else
using Type = T;
using Type = T;
#endif
};
};
${RAIIDispatchers}
${RAIIHandles}
${RAIICommandDefinitions}
using PFN_dummy = void ( * )();
${RAIIDispatchers}
}
${RAIIHandles}
${RAIICommandDefinitions}
//====================
//=== RAII Helpers ===
@ -5905,7 +5917,6 @@ std::string VulkanHppGenerator::generateCppModuleUsings() const
auto const usingTemplate = std::string{ R"( using VULKAN_HPP_NAMESPACE::${className};
)" };
auto const hardCodedTypes = std::array{ "ArrayWrapper1D", "ArrayWrapper2D", "FlagTraits", "Flags", "DispatchLoaderBase", "DispatchLoaderDynamic" };
auto const hardCodedEnhancedModeTypes = std::array{ "ArrayProxy", "ArrayProxyNoTemporaries", "StridedArrayProxy", "Optional", "StructureChain" };
auto const hardCodedSmartHandleTypes = std::array{ "ObjectDestroy", "ObjectFree", "ObjectRelease", "PoolFree", "ObjectDestroyShared",
"ObjectFreeShared", "ObjectReleaseShared", "PoolFreeShared", "SharedHandle", "UniqueHandle" };
@ -5914,15 +5925,19 @@ std::string VulkanHppGenerator::generateCppModuleUsings() const
auto usings = std::string{ R"( //=====================================
//=== HARDCODED TYPEs AND FUNCTIONs ===
//=====================================
)" };
for ( auto const & className : hardCodedTypes )
using VULKAN_HPP_NAMESPACE::ArrayWrapper1D;
using VULKAN_HPP_NAMESPACE::ArrayWrapper2D;
using VULKAN_HPP_NAMESPACE::Flags;
using VULKAN_HPP_NAMESPACE::FlagTraits;
namespace detail
{
usings += replaceWithMap( usingTemplate, { { "className", className } } );
using VULKAN_HPP_NAMESPACE::detail::DispatchLoaderBase;
using VULKAN_HPP_NAMESPACE::detail::DispatchLoaderDynamic;
#if !defined( VK_NO_PROTOTYPES )
using VULKAN_HPP_NAMESPACE::detail::DispatchLoaderStatic;
#endif /*VK_NO_PROTOTYPES*/
}
auto const & [noPrototypesEnter, noPrototypesLeave] = generateProtection( "VK_NO_PROTOTYPES", false );
usings += "\n" + noPrototypesEnter + replaceWithMap( usingTemplate, { { "className", "DispatchLoaderStatic" } } ) + noPrototypesLeave + "\n";
)" };
// insert the Flags bitwise operators
auto const flagsBitWiseOperatorsUsings = std::array{ "operator&", "operator|", "operator^", "operator~" };
@ -6050,7 +6065,10 @@ std::string VulkanHppGenerator::generateCppModuleUsings() const
usings += "\n" + enterDisableEnhanced + replaceWithMap( usingTemplate, { { "className", "StructExtends" } } ) + leaveDisableEnhanced + "\n";
auto const dynamicLoaderUsing = std::string{ R"(#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL
using VULKAN_HPP_NAMESPACE::DynamicLoader;
namespace detail
{
using VULKAN_HPP_NAMESPACE::detail::DynamicLoader;
}
#endif /*VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL*/
)" };
usings += dynamicLoaderUsing;
@ -6070,9 +6088,12 @@ std::string VulkanHppGenerator::generateCppModuleRaiiUsings() const
//======================
using VULKAN_HPP_RAII_NAMESPACE::Context;
using VULKAN_HPP_RAII_NAMESPACE::ContextDispatcher;
using VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher;
using VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher;
namespace detail
{
using VULKAN_HPP_RAII_NAMESPACE::detail::ContextDispatcher;
using VULKAN_HPP_RAII_NAMESPACE::detail::InstanceDispatcher;
using VULKAN_HPP_RAII_NAMESPACE::detail::DeviceDispatcher;
}
//====================
//=== RAII HANDLEs ===
@ -6718,7 +6739,7 @@ ${commandMembers}
template <typename DynamicLoader
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL
= VULKAN_HPP_NAMESPACE::DynamicLoader
= VULKAN_HPP_NAMESPACE::detail::DynamicLoader
#endif
>
void init()
@ -6782,7 +6803,7 @@ ${deviceCommandAssignments}
template <typename DynamicLoader
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL
= VULKAN_HPP_NAMESPACE::DynamicLoader
= VULKAN_HPP_NAMESPACE::detail::DynamicLoader
#endif
>
void init(VULKAN_HPP_NAMESPACE::Instance const & instance, VULKAN_HPP_NAMESPACE::Device const & device) VULKAN_HPP_NOEXCEPT
@ -6822,9 +6843,9 @@ std::string VulkanHppGenerator::generateDispatchLoaderStatic() const
${commands}
};
inline ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic & getDispatchLoaderStatic()
inline DispatchLoaderStatic & getDispatchLoaderStatic()
{
static ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic dls;
static DispatchLoaderStatic dls;
return dls;
}
#endif
@ -8701,7 +8722,7 @@ std::string VulkanHppGenerator::generateRAIIDispatchers() const
}
std::string contextDispatcherTemplate = R"(
class ContextDispatcher : public DispatchLoaderBase
class ContextDispatcher : public ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderBase
{
public:
ContextDispatcher( PFN_vkGetInstanceProcAddr getProcAddr )
@ -8717,7 +8738,7 @@ ${contextMembers}
std::string str = replaceWithMap( contextDispatcherTemplate, { { "contextInitializers", contextInitializers }, { "contextMembers", contextMembers } } );
std::string instanceDispatcherTemplate = R"(
class InstanceDispatcher : public DispatchLoaderBase
class InstanceDispatcher : public ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderBase
{
public:
InstanceDispatcher( PFN_vkGetInstanceProcAddr getProcAddr, VkInstance instance )
@ -8737,7 +8758,7 @@ ${instanceMembers}
str += replaceWithMap( instanceDispatcherTemplate, { { "instanceAssignments", instanceAssignments }, { "instanceMembers", instanceMembers } } );
std::string deviceDispatcherTemplate = R"(
class DeviceDispatcher : public DispatchLoaderBase
class DeviceDispatcher : public ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderBase
{
public:
DeviceDispatcher( PFN_vkGetDeviceProcAddr getProcAddr, VkDevice device ) : vkGetDeviceProcAddr( getProcAddr )
@ -8836,8 +8857,8 @@ std::string VulkanHppGenerator::generateRAIIHandle( std::pair<std::string, Handl
std::string debugReportObjectType = contains( enumIt->second.values, valueName ) ? generateEnumValueName( enumIt->first, valueName, false ) : "eUnknown";
std::string dispatcherType = ( ( handle.first == "VkDevice" ) || ( handle.second.constructorIts.front()->second.params.front().type.type == "VkDevice" ) )
? "VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher"
: "VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher";
? "VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::detail::DeviceDispatcher"
: "VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::detail::InstanceDispatcher";
std::string getParent;
if ( ( handle.first != "VkInstance" ) && ( handle.first != "VkDevice" ) && ( handle.second.destructorIt != m_commands.end() ) )
@ -9306,7 +9327,7 @@ std::string VulkanHppGenerator::generateRAIIHandleCommandFactory( std::string co
std::string const definitionTemplate =
R"(
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::CreateReturnType<${returnType}>::Type ${className}::${commandName}( ${argumentList} ) const ${noexcept}
VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::detail::CreateReturnType<${returnType}>::Type ${className}::${commandName}( ${argumentList} ) const ${noexcept}
{
${specialAssertion}
${dataDeclarations}
@ -9332,7 +9353,7 @@ std::string VulkanHppGenerator::generateRAIIHandleCommandFactory( std::string co
{
std::string const declarationTemplate =
R"(
VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::CreateReturnType<${returnType}>::Type ${commandName}( ${argumentList} ) const ${noexcept};
VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::detail::CreateReturnType<${returnType}>::Type ${commandName}( ${argumentList} ) const ${noexcept};
)";
return replaceWithMap( declarationTemplate,
@ -9965,7 +9986,7 @@ std::string VulkanHppGenerator::generateRAIIHandleConstructorTakeOwnership( std:
std::string dispatcherInit;
if ( ( handle.first == "VkDevice" ) || ( handle.first == "VkInstance" ) )
{
dispatcherInit = "\n m_dispatcher.reset( new VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::" + handleType + "Dispatcher( " + parentName +
dispatcherInit = "\n m_dispatcher.reset( new VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::detail::" + handleType + "Dispatcher( " + parentName +
".getDispatcher()->vkGet" + handleType + "ProcAddr, static_cast<" + handle.first + ">( m_" + startLowerCase( handleType ) + " ) ) );";
}
@ -10012,11 +10033,11 @@ std::string VulkanHppGenerator::generateRAIIHandleContext( std::pair<std::string
public:
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL
Context()
: m_dispatcher( new VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::ContextDispatcher(
: m_dispatcher( new VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::detail::ContextDispatcher(
m_dynamicLoader.getProcAddress<PFN_vkGetInstanceProcAddr>( "vkGetInstanceProcAddr" ) ) )
#else
Context( PFN_vkGetInstanceProcAddr getInstanceProcAddr )
: m_dispatcher( new VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::ContextDispatcher( getInstanceProcAddr ) )
: m_dispatcher( new VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::detail::ContextDispatcher( getInstanceProcAddr ) )
#endif
{}
@ -10044,7 +10065,7 @@ std::string VulkanHppGenerator::generateRAIIHandleContext( std::pair<std::string
return *this;
}
VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::ContextDispatcher const * getDispatcher() const
VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::detail::ContextDispatcher const * getDispatcher() const
{
VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION );
return &*m_dispatcher;
@ -10062,9 +10083,9 @@ ${memberFunctionDeclarations}
private:
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL
VULKAN_HPP_NAMESPACE::DynamicLoader m_dynamicLoader;
VULKAN_HPP_NAMESPACE::detail::DynamicLoader m_dynamicLoader;
#endif
std::unique_ptr<VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::ContextDispatcher> m_dispatcher;
std::unique_ptr<VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::detail::ContextDispatcher> m_dispatcher;
};
)";
@ -10231,19 +10252,19 @@ std::tuple<std::string, std::string, std::string, std::string, std::string, std:
if ( handle.first == "VkInstance" )
{
memberVariables += "\n std::unique_ptr<VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher> m_dispatcher;";
memberVariables += "\n std::unique_ptr<VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::detail::InstanceDispatcher> m_dispatcher;";
}
else if ( handle.first == "VkDevice" )
{
memberVariables += "\n std::unique_ptr<VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher> m_dispatcher;";
memberVariables += "\n std::unique_ptr<VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::detail::DeviceDispatcher> m_dispatcher;";
}
else if ( handle.second.constructorIts.front()->second.params.front().type.type == "VkDevice" )
{
memberVariables += "\n VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr;";
memberVariables += "\n VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::detail::DeviceDispatcher const * m_dispatcher = nullptr;";
}
else
{
memberVariables += "\n VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * m_dispatcher = nullptr;";
memberVariables += "\n VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::detail::InstanceDispatcher const * m_dispatcher = nullptr;";
}
clearMembers += "\n m_dispatcher = nullptr;";
swapMembers += "\n std::swap( m_dispatcher, rhs.m_dispatcher );";

View File

@ -1,69 +0,0 @@
class DispatchLoaderDynamic;
#if !defined(VULKAN_HPP_DISPATCH_LOADER_DYNAMIC)
# if defined( VK_NO_PROTOTYPES )
# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1
# else
# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 0
# endif
#endif
#if !defined( VULKAN_HPP_STORAGE_API )
# if defined( VULKAN_HPP_STORAGE_SHARED )
# if defined( _MSC_VER )
# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT )
# define VULKAN_HPP_STORAGE_API __declspec( dllexport )
# else
# define VULKAN_HPP_STORAGE_API __declspec( dllimport )
# endif
# elif defined( __clang__ ) || defined( __GNUC__ )
# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT )
# define VULKAN_HPP_STORAGE_API __attribute__( ( visibility( "default" ) ) )
# else
# define VULKAN_HPP_STORAGE_API
# endif
# else
# define VULKAN_HPP_STORAGE_API
# pragma warning Unknown import / export semantics
# endif
# else
# define VULKAN_HPP_STORAGE_API
# endif
#endif
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::defaultDispatchLoaderDynamic
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \
namespace VULKAN_HPP_NAMESPACE \
{ \
VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic; \
}
extern VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic;
# else
inline ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic & getDispatchLoaderStatic()
{
static ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic dls;
return dls;
}
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::getDispatchLoaderStatic()
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
# endif
#endif
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER_TYPE )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic
# else
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic
# endif
#endif
#if defined( VULKAN_HPP_NO_DEFAULT_DISPATCHER )
# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT
# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT
# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT
#else
# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT = {}
# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT = nullptr
# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT = VULKAN_HPP_DEFAULT_DISPATCHER
#endif

View File

@ -46,9 +46,9 @@ public:
}
private:
DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr;
const DispatchLoaderBase * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
};
template <typename HandleType>
@ -77,9 +77,9 @@ public:
}
private:
DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr;
const DispatchLoaderBase * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
};
template <typename HandleType>
@ -106,8 +106,8 @@ public:
}
private:
DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr;
const DispatchLoaderBase * m_dispatch = nullptr;
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
};
template <typename HandleType, typename PoolType>
@ -142,9 +142,9 @@ public:
}
private:
DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr;
const DispatchLoaderBase * m_dispatch = nullptr;
SharedHandle<PoolType> m_pool{};
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
SharedHandle<PoolType> m_pool{};
};
#if defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __INTEL_COMPILER )

View File

@ -240,33 +240,40 @@ ${vulkan_64_bit_ptr_defines}
namespace VULKAN_HPP_NAMESPACE
{
class DispatchLoaderDynamic;
namespace detail
{
class DispatchLoaderDynamic;
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
extern VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic;
# endif
#endif
} // namespace detail
} // namespace VULKAN_HPP_NAMESPACE
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::defaultDispatchLoaderDynamic
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \
namespace VULKAN_HPP_NAMESPACE \
{ \
VULKAN_HPP_STORAGE_API ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic defaultDispatchLoaderDynamic; \
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::defaultDispatchLoaderDynamic
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \
namespace VULKAN_HPP_NAMESPACE \
{ \
namespace detail \
{ \
VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic; \
} \
}
namespace VULKAN_HPP_NAMESPACE
{
extern VULKAN_HPP_STORAGE_API VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic defaultDispatchLoaderDynamic;
} // namespace VULKAN_HPP_NAMESPACE
# else
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::getDispatchLoaderStatic()
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::getDispatchLoaderStatic()
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
# endif
#endif
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER_TYPE )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderDynamic
# else
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderStatic
# endif
#endif

View File

@ -39,9 +39,6 @@ int main( int /*argc*/, char ** /*argv*/ )
{
try
{
// to prevent a warning on unreferenced function vk::getDispatchLoaderStatic, use just one arbitrary vk-function
(void)vk::enumerateInstanceVersion();
// nullptr_t
fct( nullptr );
fctc( nullptr );

View File

@ -49,9 +49,6 @@ MyVulkanTest::MyVulkanTest()
int main( int /*argc*/, char ** /*argv*/ )
{
// to prevent a warning on unreferenced function vk::getDispatchLoaderStatic, use just one arbitrary vk-function
(void)vk::enumerateInstanceVersion();
char const * appName = "DesignatedInitializers";
uint32_t appVersion = 1;
char const * engineName = "Vulkan.hpp";

View File

@ -60,16 +60,16 @@ int main( int /*argc*/, char ** /*argv*/ )
vk::DeviceQueueCreateInfo deviceQueueCreateInfo( vk::DeviceQueueCreateFlags(), static_cast<uint32_t>( graphicsQueueFamilyIndex ), 1, &queuePriority );
vk::UniqueDevice device = physicalDevice.createDeviceUnique( vk::DeviceCreateInfo( vk::DeviceCreateFlags(), deviceQueueCreateInfo ) );
uint64_t handle = device->getAccelerationStructureHandleNV<uint8_t>( {}, vk::DispatchLoaderDynamic() );
uint64_t handle = device->getAccelerationStructureHandleNV<uint8_t>( {}, vk::detail::DispatchLoaderDynamic() );
std::vector<vk::UniqueCommandBuffer>::allocator_type vectorAllocator;
vk::UniqueCommandBuffer commandBuffer = std::move( device->allocateCommandBuffersUnique( {}, vectorAllocator, vk::DispatchLoaderStatic() ).front() );
vk::UniqueCommandBuffer commandBuffer = std::move( device->allocateCommandBuffersUnique( {}, vectorAllocator, vk::detail::DispatchLoaderStatic() ).front() );
commandBuffer->begin( vk::CommandBufferBeginInfo() );
std::vector<vk::UniqueHandle<vk::CommandBuffer, vk::DispatchLoaderDynamic>>::allocator_type dynamicVectorAllocator;
vk::UniqueHandle<vk::CommandBuffer, vk::DispatchLoaderDynamic> dynamicCommandBuffer =
std::move( device->allocateCommandBuffersUnique( {}, dynamicVectorAllocator, vk::DispatchLoaderDynamic() ).front() );
std::vector<vk::UniqueHandle<vk::CommandBuffer, vk::detail::DispatchLoaderDynamic>>::allocator_type dynamicVectorAllocator;
vk::UniqueHandle<vk::CommandBuffer, vk::detail::DispatchLoaderDynamic> dynamicCommandBuffer =
std::move( device->allocateCommandBuffersUnique( {}, dynamicVectorAllocator, vk::detail::DispatchLoaderDynamic() ).front() );
vk::Buffer buffer = device->createBuffer( {} );
vk::UniqueBuffer uniqueBuffer = vk::UniqueBuffer( buffer, *device );

View File

@ -33,7 +33,7 @@ int main( int /*argc*/, char ** /*argv*/ )
VULKAN_HPP_DEFAULT_DISPATCHER.init();
// the same initialization, now with explicitly providing a DynamicLoader
vk::DynamicLoader dl;
vk::detail::DynamicLoader dl;
VULKAN_HPP_DEFAULT_DISPATCHER.init( dl );
// the same initialization, now with explicitly providing the initial function pointer

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
// VulkanHpp Samples : DispatchLoaderDynamic
// VulkanHpp Samples : DispatchLoaderDynamicSharedLibrary
// Compile test on DispatchLoaderDynamic functions
#include <vulkan/vulkan.hpp>

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
// VulkanHpp Samples : DispatchLoaderDynamic
// VulkanHpp Samples : DispatchLoaderDynamicSharedLibraryClient
// Compile test on DispatchLoaderDynamic functions
#include <iostream>

View File

@ -39,9 +39,6 @@ int main( int /*argc*/, char ** /*argv*/ )
{
try
{
// to prevent a warning on unreferenced function vk::getDispatchLoaderStatic, use just one arbitrary vk-function
// (void)vk::enumerateInstanceVersion();
// nullptr_t
fct( nullptr );
fctc( nullptr );

View File

@ -358,11 +358,11 @@ int main( int /*argc*/, char ** /*argv*/ )
vk::UniquePipeline graphicsPipeline = device->createGraphicsPipelineUnique( *pipelineCache, graphicsPipelineCreateInfo ).value;
vk::UniquePipeline graphicsPipeline2 =
std::move( device->createGraphicsPipelinesUnique<vk::DispatchLoaderDynamic, MyAllocator<vk::UniquePipeline>>( *pipelineCache, graphicsPipelineCreateInfo )
std::move( device->createGraphicsPipelinesUnique<vk::detail::DispatchLoaderDynamic, MyAllocator<vk::UniquePipeline>>( *pipelineCache, graphicsPipelineCreateInfo )
.value[0] );
vk::UniquePipeline graphicsPipeline3 =
std::move( device->createGraphicsPipelinesUnique<vk::DispatchLoaderDynamic>( *pipelineCache, graphicsPipelineCreateInfo ).value[0] );
std::move( device->createGraphicsPipelinesUnique<vk::detail::DispatchLoaderDynamic>( *pipelineCache, graphicsPipelineCreateInfo ).value[0] );
vk::DescriptorPoolSize poolSize( vk::DescriptorType::eUniformBuffer, 1 );
vk::UniqueDescriptorPool descriptorPool = device->createDescriptorPoolUnique( { vk::DescriptorPoolCreateFlagBits::eFreeDescriptorSet, 1, poolSize } );

View File

@ -32,14 +32,17 @@ export namespace VULKAN_HPP_NAMESPACE
//=====================================
using VULKAN_HPP_NAMESPACE::ArrayWrapper1D;
using VULKAN_HPP_NAMESPACE::ArrayWrapper2D;
using VULKAN_HPP_NAMESPACE::DispatchLoaderBase;
using VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic;
using VULKAN_HPP_NAMESPACE::Flags;
using VULKAN_HPP_NAMESPACE::FlagTraits;
namespace detail
{
using VULKAN_HPP_NAMESPACE::detail::DispatchLoaderBase;
using VULKAN_HPP_NAMESPACE::detail::DispatchLoaderDynamic;
#if !defined( VK_NO_PROTOTYPES )
using VULKAN_HPP_NAMESPACE::DispatchLoaderStatic;
using VULKAN_HPP_NAMESPACE::detail::DispatchLoaderStatic;
#endif /*VK_NO_PROTOTYPES*/
} // namespace detail
using VULKAN_HPP_NAMESPACE::operator&;
using VULKAN_HPP_NAMESPACE::operator|;
@ -4883,7 +4886,10 @@ export namespace VULKAN_HPP_NAMESPACE
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL
using VULKAN_HPP_NAMESPACE::DynamicLoader;
namespace detail
{
using VULKAN_HPP_NAMESPACE::detail::DynamicLoader;
} // namespace detail
#endif /*VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL*/
//=====================
@ -4933,9 +4939,13 @@ export namespace VULKAN_HPP_NAMESPACE
//======================
using VULKAN_HPP_RAII_NAMESPACE::Context;
using VULKAN_HPP_RAII_NAMESPACE::ContextDispatcher;
using VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher;
using VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher;
namespace detail
{
using VULKAN_HPP_RAII_NAMESPACE::detail::ContextDispatcher;
using VULKAN_HPP_RAII_NAMESPACE::detail::DeviceDispatcher;
using VULKAN_HPP_RAII_NAMESPACE::detail::InstanceDispatcher;
} // namespace detail
//====================
//=== RAII HANDLEs ===

File diff suppressed because it is too large Load Diff

View File

@ -257,33 +257,40 @@
namespace VULKAN_HPP_NAMESPACE
{
class DispatchLoaderDynamic;
namespace detail
{
class DispatchLoaderDynamic;
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
extern VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic;
# endif
#endif
} // namespace detail
} // namespace VULKAN_HPP_NAMESPACE
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::defaultDispatchLoaderDynamic
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \
namespace VULKAN_HPP_NAMESPACE \
{ \
VULKAN_HPP_STORAGE_API ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic defaultDispatchLoaderDynamic; \
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::defaultDispatchLoaderDynamic
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \
namespace VULKAN_HPP_NAMESPACE \
{ \
namespace detail \
{ \
VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic; \
} \
}
namespace VULKAN_HPP_NAMESPACE
{
extern VULKAN_HPP_STORAGE_API VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic defaultDispatchLoaderDynamic;
} // namespace VULKAN_HPP_NAMESPACE
# else
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::getDispatchLoaderStatic()
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::getDispatchLoaderStatic()
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
# endif
#endif
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER_TYPE )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderDynamic
# else
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderStatic
# endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -356,9 +356,9 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr;
const DispatchLoaderBase * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
};
template <typename HandleType>
@ -387,9 +387,9 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr;
const DispatchLoaderBase * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
};
template <typename HandleType>
@ -416,8 +416,8 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr;
const DispatchLoaderBase * m_dispatch = nullptr;
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
};
template <typename HandleType, typename PoolType>
@ -452,9 +452,9 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr;
const DispatchLoaderBase * m_dispatch = nullptr;
SharedHandle<PoolType> m_pool{};
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
SharedHandle<PoolType> m_pool{};
};
# if defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __INTEL_COMPILER )

View File

@ -32,14 +32,17 @@ export namespace VULKAN_HPP_NAMESPACE
//=====================================
using VULKAN_HPP_NAMESPACE::ArrayWrapper1D;
using VULKAN_HPP_NAMESPACE::ArrayWrapper2D;
using VULKAN_HPP_NAMESPACE::DispatchLoaderBase;
using VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic;
using VULKAN_HPP_NAMESPACE::Flags;
using VULKAN_HPP_NAMESPACE::FlagTraits;
namespace detail
{
using VULKAN_HPP_NAMESPACE::detail::DispatchLoaderBase;
using VULKAN_HPP_NAMESPACE::detail::DispatchLoaderDynamic;
#if !defined( VK_NO_PROTOTYPES )
using VULKAN_HPP_NAMESPACE::DispatchLoaderStatic;
using VULKAN_HPP_NAMESPACE::detail::DispatchLoaderStatic;
#endif /*VK_NO_PROTOTYPES*/
} // namespace detail
using VULKAN_HPP_NAMESPACE::operator&;
using VULKAN_HPP_NAMESPACE::operator|;
@ -1797,7 +1800,10 @@ export namespace VULKAN_HPP_NAMESPACE
#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL
using VULKAN_HPP_NAMESPACE::DynamicLoader;
namespace detail
{
using VULKAN_HPP_NAMESPACE::detail::DynamicLoader;
} // namespace detail
#endif /*VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL*/
//=====================
@ -1847,9 +1853,13 @@ export namespace VULKAN_HPP_NAMESPACE
//======================
using VULKAN_HPP_RAII_NAMESPACE::Context;
using VULKAN_HPP_RAII_NAMESPACE::ContextDispatcher;
using VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher;
using VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher;
namespace detail
{
using VULKAN_HPP_RAII_NAMESPACE::detail::ContextDispatcher;
using VULKAN_HPP_RAII_NAMESPACE::detail::DeviceDispatcher;
using VULKAN_HPP_RAII_NAMESPACE::detail::InstanceDispatcher;
} // namespace detail
//====================
//=== RAII HANDLEs ===

File diff suppressed because it is too large Load Diff

View File

@ -257,33 +257,40 @@
namespace VULKAN_HPP_NAMESPACE
{
class DispatchLoaderDynamic;
namespace detail
{
class DispatchLoaderDynamic;
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
extern VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic;
# endif
#endif
} // namespace detail
} // namespace VULKAN_HPP_NAMESPACE
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::defaultDispatchLoaderDynamic
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \
namespace VULKAN_HPP_NAMESPACE \
{ \
VULKAN_HPP_STORAGE_API ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic defaultDispatchLoaderDynamic; \
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::defaultDispatchLoaderDynamic
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \
namespace VULKAN_HPP_NAMESPACE \
{ \
namespace detail \
{ \
VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic; \
} \
}
namespace VULKAN_HPP_NAMESPACE
{
extern VULKAN_HPP_STORAGE_API VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic defaultDispatchLoaderDynamic;
} // namespace VULKAN_HPP_NAMESPACE
# else
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::getDispatchLoaderStatic()
# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::detail::getDispatchLoaderStatic()
# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
# endif
#endif
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER_TYPE )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderDynamic
# else
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic
# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::detail::DispatchLoaderStatic
# endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -356,9 +356,9 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr;
const DispatchLoaderBase * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
};
template <typename HandleType>
@ -387,9 +387,9 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr;
const DispatchLoaderBase * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
};
template <typename HandleType>
@ -416,8 +416,8 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr;
const DispatchLoaderBase * m_dispatch = nullptr;
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
};
template <typename HandleType, typename PoolType>
@ -452,9 +452,9 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
DestroyFunctionPointerType<DispatchLoaderBase> m_destroy = nullptr;
const DispatchLoaderBase * m_dispatch = nullptr;
SharedHandle<PoolType> m_pool{};
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr;
SharedHandle<PoolType> m_pool{};
};
# if defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __INTEL_COMPILER )