Replace some more "vk::" by "VULKAN_HPP_NAMESPACE::" (#2095)

This commit is contained in:
Andreas Süßenbach 2025-03-06 17:19:37 +01:00 committed by GitHub
parent 325602c26a
commit da9db0c8a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 133 additions and 114 deletions

View File

@ -8460,7 +8460,7 @@ std::string VulkanHppGenerator::generateLayerSettingTypeTraits() const
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eBool32>
{
using Type = vk::Bool32;
using Type = VULKAN_HPP_NAMESPACE::Bool32;
};
template <>
@ -10182,7 +10182,7 @@ std::string VulkanHppGenerator::generateRAIIHandleDestructorCallArguments( std::
}
else if ( param.type.type == "VkAllocationCallbacks" )
{
// vk::AllocationCallbacks is stored as a member of the handle class
// VULKAN_HPP_NAMESPACE::AllocationCallbacks is stored as a member of the handle class
arguments.push_back( "reinterpret_cast<const VkAllocationCallbacks *>( m_allocator )" );
}
else if ( isHandleType( param.type.type ) )
@ -10392,7 +10392,7 @@ ${forwardDeclarations}
${raiiHandles}
// operators to compare vk::raii-handles
// operators to compare VULKAN_HPP_NAMESPACE::raii-handles
#if defined(VULKAN_HPP_HAS_SPACESHIP_OPERATOR)
template <typename T, typename std::enable_if<VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::isVulkanRAIIHandleType<T>::value,bool>::type = 0>
auto operator<=>( T const & a, T const & b ) VULKAN_HPP_NOEXCEPT
@ -11370,7 +11370,7 @@ std::string VulkanHppGenerator::generateStructConstructorsEnhanced( std::pair<st
( structData.second.members[3].name == "valueCount" ) && ( structData.second.members[4].name == "pValues" ) );
static const std::string byTypeTemplate =
R"( LayerSettingEXT( char const * pLayerName_, char const * pSettingName_, VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_, vk::ArrayProxyNoTemporaries<const ${type}> const & values_ )
R"( LayerSettingEXT( char const * pLayerName_, char const * pSettingName_, VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_, VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const ${type}> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
@ -11382,7 +11382,7 @@ std::string VulkanHppGenerator::generateStructConstructorsEnhanced( std::pair<st
static const std::string constructorTemplate = R"(
#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
// NOTE: you need to provide the type because vk::Bool32 and uint32_t are indistinguishable!
// NOTE: you need to provide the type because VULKAN_HPP_NAMESPACE::Bool32 and uint32_t are indistinguishable!
${byInt32}
${byInt64}
${byUint32}
@ -11764,7 +11764,7 @@ std::string VulkanHppGenerator::generateStructure( std::pair<std::string, Struct
std::string constructorsAndSetters;
if ( strcmp( &structure.first[0], "VkDeviceFaultInfoEXT" ) == 0 )
{
// special handling for this structure, as it is filled with dynamic memory on vk::Device::getFaultInfoEXT!
// special handling for this structure, as it is filled with dynamic memory on VULKAN_HPP_NAMESPACE::Device::getFaultInfoEXT!
constructorsAndSetters += R"(
#if !defined( VULKAN_HPP_NO_CONSTRUCTORS ) && !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS )
VULKAN_HPP_CONSTEXPR_14 DeviceFaultInfoEXT( std::array<char, VK_MAX_DESCRIPTION_SIZE> const & description_ = {},

View File

@ -39,9 +39,9 @@ export namespace std
{
${hashSpecializations}
//===============================================
//=== Required exports for vk::StructureChain ===
//===============================================
//=================================================================
//=== Required exports for VULKAN_HPP_NAMESPACE::StructureChain ===
//=================================================================
#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
using std::tuple_size;

View File

@ -13,7 +13,7 @@ namespace VULKAN_HPP_NAMESPACE
${uniqueHandles}
${handles}
// operators to compare vk::-handles
// operators to compare VULKAN_HPP_NAMESPACE::-handles
#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR )
template <typename T, typename std::enable_if<VULKAN_HPP_NAMESPACE::isVulkanHandleType<T>::value, int>::type = 0>
auto operator<=>( T const & lhs, T const & rhs )

View File

@ -1,62 +1,81 @@
template <typename OwnerType, typename Dispatch>
class ObjectDestroy
template <typename OwnerType, typename Dispatch>
class ObjectDestroy
{
public:
ObjectDestroy() = default;
ObjectDestroy( OwnerType owner,
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT,
Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT
: m_owner( owner )
, m_allocationCallbacks( allocationCallbacks )
, m_dispatch( &dispatch )
{
public:
ObjectDestroy() = default;
}
ObjectDestroy( OwnerType owner,
Optional<const vk::AllocationCallbacks> allocationCallbacks
VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT,
Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT
: m_owner( owner )
, m_allocationCallbacks( allocationCallbacks )
, m_dispatch( &dispatch )
{}
OwnerType getOwner() const VULKAN_HPP_NOEXCEPT { return m_owner; }
Optional<const vk::AllocationCallbacks> getAllocator() const VULKAN_HPP_NOEXCEPT { return m_allocationCallbacks; }
Dispatch const & getDispatch() const VULKAN_HPP_NOEXCEPT { return *m_dispatch; }
protected:
template <typename T>
void destroy(T t) VULKAN_HPP_NOEXCEPT
{
VULKAN_HPP_ASSERT( m_owner && m_dispatch );
m_owner.destroy( t, m_allocationCallbacks, *m_dispatch );
}
private:
OwnerType m_owner = {};
Optional<const vk::AllocationCallbacks> m_allocationCallbacks = nullptr;
Dispatch const * m_dispatch = nullptr;
};
class NoParent;
template <typename Dispatch>
class ObjectDestroy<NoParent, Dispatch>
OwnerType getOwner() const VULKAN_HPP_NOEXCEPT
{
public:
ObjectDestroy() = default;
return m_owner;
}
ObjectDestroy( Optional<const vk::AllocationCallbacks> allocationCallbacks,
Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT
: m_allocationCallbacks( allocationCallbacks )
, m_dispatch( &dispatch )
{}
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> getAllocator() const VULKAN_HPP_NOEXCEPT
{
return m_allocationCallbacks;
}
Optional<const vk::AllocationCallbacks> getAllocator() const VULKAN_HPP_NOEXCEPT { return m_allocationCallbacks; }
Dispatch const & getDispatch() const VULKAN_HPP_NOEXCEPT { return *m_dispatch; }
Dispatch const & getDispatch() const VULKAN_HPP_NOEXCEPT
{
return *m_dispatch;
}
protected:
template <typename T>
void destroy(T t) VULKAN_HPP_NOEXCEPT
{
VULKAN_HPP_ASSERT( m_dispatch );
t.destroy( m_allocationCallbacks, *m_dispatch );
}
protected:
template <typename T>
void destroy( T t ) VULKAN_HPP_NOEXCEPT
{
VULKAN_HPP_ASSERT( m_owner && m_dispatch );
m_owner.destroy( t, m_allocationCallbacks, *m_dispatch );
}
private:
Optional<const vk::AllocationCallbacks> m_allocationCallbacks = nullptr;
Dispatch const * m_dispatch = nullptr;
};
private:
OwnerType m_owner = {};
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> m_allocationCallbacks = nullptr;
Dispatch const * m_dispatch = nullptr;
};
class NoParent;
template <typename Dispatch>
class ObjectDestroy<NoParent, Dispatch>
{
public:
ObjectDestroy() = default;
ObjectDestroy( Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> allocationCallbacks,
Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT
: m_allocationCallbacks( allocationCallbacks )
, m_dispatch( &dispatch )
{
}
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> getAllocator() const VULKAN_HPP_NOEXCEPT
{
return m_allocationCallbacks;
}
Dispatch const & getDispatch() const VULKAN_HPP_NOEXCEPT
{
return *m_dispatch;
}
protected:
template <typename T>
void destroy( T t ) VULKAN_HPP_NOEXCEPT
{
VULKAN_HPP_ASSERT( m_dispatch );
t.destroy( m_allocationCallbacks, *m_dispatch );
}
private:
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> m_allocationCallbacks = nullptr;
Dispatch const * m_dispatch = nullptr;
};

View File

@ -14,7 +14,7 @@
# undef MemoryBarrier
#endif
// XLib.h defines True/False, which collides with our vk::True/vk::False
// XLib.h defines True/False, which collides with our VULKAN_HPP_NAMESPACE::True/VULKAN_HPP_NAMESPACE::False
// -> undef them and provide some namepace-secure constexpr
#if defined( True )
# undef True

View File

@ -8505,9 +8505,9 @@ export namespace std
struct hash<VULKAN_HPP_NAMESPACE::PhysicalDevicePresentMeteringFeaturesNV>;
#endif /*VK_ENABLE_BETA_EXTENSIONS*/
//===============================================
//=== Required exports for vk::StructureChain ===
//===============================================
//=================================================================
//=== Required exports for VULKAN_HPP_NAMESPACE::StructureChain ===
//=================================================================
#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
using std::tuple_element;

View File

@ -81,7 +81,7 @@ static_assert( VK_HEADER_VERSION == 309, "Wrong VK_HEADER_VERSION!" );
# undef MemoryBarrier
#endif
// XLib.h defines True/False, which collides with our vk::True/vk::False
// XLib.h defines True/False, which collides with our VULKAN_HPP_NAMESPACE::True/VULKAN_HPP_NAMESPACE::False
// -> undef them and provide some namepace-secure constexpr
#if defined( True )
# undef True
@ -6252,9 +6252,9 @@ namespace VULKAN_HPP_NAMESPACE
public:
ObjectDestroy() = default;
ObjectDestroy( OwnerType owner,
Optional<const vk::AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT,
Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT
ObjectDestroy( OwnerType owner,
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT,
Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT
: m_owner( owner )
, m_allocationCallbacks( allocationCallbacks )
, m_dispatch( &dispatch )
@ -6266,7 +6266,7 @@ namespace VULKAN_HPP_NAMESPACE
return m_owner;
}
Optional<const vk::AllocationCallbacks> getAllocator() const VULKAN_HPP_NOEXCEPT
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> getAllocator() const VULKAN_HPP_NOEXCEPT
{
return m_allocationCallbacks;
}
@ -6285,9 +6285,9 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
OwnerType m_owner = {};
Optional<const vk::AllocationCallbacks> m_allocationCallbacks = nullptr;
Dispatch const * m_dispatch = nullptr;
OwnerType m_owner = {};
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> m_allocationCallbacks = nullptr;
Dispatch const * m_dispatch = nullptr;
};
class NoParent;
@ -6298,14 +6298,14 @@ namespace VULKAN_HPP_NAMESPACE
public:
ObjectDestroy() = default;
ObjectDestroy( Optional<const vk::AllocationCallbacks> allocationCallbacks,
Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT
ObjectDestroy( Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> allocationCallbacks,
Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT
: m_allocationCallbacks( allocationCallbacks )
, m_dispatch( &dispatch )
{
}
Optional<const vk::AllocationCallbacks> getAllocator() const VULKAN_HPP_NOEXCEPT
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> getAllocator() const VULKAN_HPP_NOEXCEPT
{
return m_allocationCallbacks;
}
@ -6324,8 +6324,8 @@ namespace VULKAN_HPP_NAMESPACE
}
private:
Optional<const vk::AllocationCallbacks> m_allocationCallbacks = nullptr;
Dispatch const * m_dispatch = nullptr;
Optional<const VULKAN_HPP_NAMESPACE::AllocationCallbacks> m_allocationCallbacks = nullptr;
Dispatch const * m_dispatch = nullptr;
};
template <typename OwnerType, typename Dispatch>

View File

@ -8182,7 +8182,7 @@ namespace VULKAN_HPP_NAMESPACE
template <>
struct CppType<LayerSettingTypeEXT, LayerSettingTypeEXT::eBool32>
{
using Type = vk::Bool32;
using Type = VULKAN_HPP_NAMESPACE::Bool32;
};
template <>

View File

@ -20426,7 +20426,7 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_NODISCARD typename ResultValueType<uint32_t>::type enumerateInstanceVersion( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT );
#endif /* VULKAN_HPP_DISABLE_ENHANCED_MODE */
// operators to compare vk::-handles
// operators to compare VULKAN_HPP_NAMESPACE::-handles
#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR )
template <typename T, typename std::enable_if<VULKAN_HPP_NAMESPACE::isVulkanHandleType<T>::value, int>::type = 0>
auto operator<=>( T const & lhs, T const & rhs )

View File

@ -14252,7 +14252,7 @@ namespace VULKAN_HPP_NAMESPACE
static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true;
};
// operators to compare vk::raii-handles
// operators to compare VULKAN_HPP_NAMESPACE::raii-handles
# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR )
template <typename T, typename std::enable_if<VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::isVulkanRAIIHandleType<T>::value, bool>::type = 0>
auto operator<=>( T const & a, T const & b ) VULKAN_HPP_NOEXCEPT

View File

@ -61569,11 +61569,11 @@ namespace VULKAN_HPP_NAMESPACE
LayerSettingEXT( VkLayerSettingEXT const & rhs ) VULKAN_HPP_NOEXCEPT : LayerSettingEXT( *reinterpret_cast<LayerSettingEXT const *>( &rhs ) ) {}
# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
// NOTE: you need to provide the type because vk::Bool32 and uint32_t are indistinguishable!
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const int32_t> const & values_ )
// NOTE: you need to provide the type because VULKAN_HPP_NAMESPACE::Bool32 and uint32_t are indistinguishable!
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const int32_t> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
@ -61583,10 +61583,10 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<int32_t>( type ) );
}
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const int64_t> const & values_ )
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const int64_t> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
@ -61596,10 +61596,10 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<int64_t>( type ) );
}
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const uint32_t> const & values_ )
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const uint32_t> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
@ -61609,10 +61609,10 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<uint32_t>( type ) );
}
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const uint64_t> const & values_ )
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const uint64_t> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
@ -61622,10 +61622,10 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<uint64_t>( type ) );
}
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const float> const & values_ )
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const float> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
@ -61635,10 +61635,10 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<float>( type ) );
}
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const double> const & values_ )
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const double> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )
@ -61648,10 +61648,10 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( VULKAN_HPP_NAMESPACE::isSameType<double>( type ) );
}
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
vk::ArrayProxyNoTemporaries<const char *> const & values_ )
LayerSettingEXT( char const * pLayerName_,
char const * pSettingName_,
VULKAN_HPP_NAMESPACE::LayerSettingTypeEXT type_,
VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries<const char *> const & values_ )
: pLayerName( pLayerName_ )
, pSettingName( pSettingName_ )
, type( type_ )