Compare commits

...

5 Commits

Author SHA1 Message Date
Sharadh Rajaraman 10be59a321
Merge 9896e08beb into 8e79f71c15 2025-11-14 00:05:34 +00:00
Andreas Süßenbach 8e79f71c15
Extend enum value alias handling. (#2361)
Set Version Tag / set-version-tag (push) Has been cancelled Details
2025-11-13 14:09:34 +01:00
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
Sharadh Rajaraman 9896e08beb Adhere to some markdownlint recommendations
- `-` instead of `*`
- Spaces around lists
2025-11-11 21:58:53 +00:00
Sharadh Rajaraman 044bf61a3c Initial readme rework
- Remove HTML hyperlinks; markdown generates automatically
- Use backticks \` to demarcate config macros
- Remove `VULKAN_HPP_NO_STD_MODULE` option
2025-11-11 21:56:36 +00:00
10 changed files with 5310 additions and 4686 deletions

2038
README.md

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,8 @@ using namespace std::literals;
namespace namespace
{ {
template <typename T>
bool containsByName( std::vector<T> const & values, std::string const & name );
std::vector<std::pair<std::string, size_t>> filterNumbers( std::vector<std::string> const & names ); std::vector<std::pair<std::string, size_t>> filterNumbers( std::vector<std::string> const & names );
template <typename T> template <typename T>
typename std::vector<T>::const_iterator findByName( std::vector<T> const & values, std::string const & name ); typename std::vector<T>::const_iterator findByName( std::vector<T> const & values, std::string const & name );
@ -1552,40 +1554,8 @@ std::set<size_t> VulkanHppGenerator::determineVoidPointerParams( std::vector<Par
return voidPointerParams; return voidPointerParams;
} }
void VulkanHppGenerator::distributeEnumExtends()
{
for ( auto const & extendedEnum : m_enumExtends )
{
assert( !extendedEnum.second.empty() );
auto typeIt = m_types.find( extendedEnum.first );
checkForError( typeIt != m_types.end(),
extendedEnum.second.front().xmlLine,
"enum value <" + extendedEnum.second.front().name + "> extends unknown type <" + extendedEnum.first + ">" );
checkForError( typeIt->second.category == TypeCategory::Enum,
extendedEnum.second.front().xmlLine,
"enum value <" + extendedEnum.second.front().name + "> extends non-enum type <" + extendedEnum.first + ">" );
const auto enumIt = m_enums.find( extendedEnum.first );
assert( enumIt != m_enums.end() );
for ( auto const & eed : extendedEnum.second )
{
for ( auto const & requiredBy : eed.requiredBy )
{
typeIt->second.requiredBy.insert( requiredBy );
}
checkForError( enumIt->second.addEnumAlias( eed.xmlLine, eed.name, eed.alias, eed.protect, ( eed.api.empty() || ( eed.api == m_api ) ) && eed.supported ),
eed.xmlLine,
"enum value alias <" + eed.name + "> already listed with different properties" );
}
}
m_enumExtends.clear();
}
void VulkanHppGenerator::distributeEnumValueAliases() void VulkanHppGenerator::distributeEnumValueAliases()
{ {
assert( m_enumExtends.empty() );
for ( auto & e : m_enums ) for ( auto & e : m_enums )
{ {
for ( auto & a : e.second.valueAliases ) for ( auto & a : e.second.valueAliases )
@ -1710,7 +1680,7 @@ void VulkanHppGenerator::extendSpecialCommands( std::string const & name, bool d
cmd.insert( cmd.insert(
pos, pos,
R"( // wrapper function for command vkSetDebugUtilsObjectNameEXT, see https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectNameEXT.html 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 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 Device::setDebugUtilsObjectNameEXT( HandleType const & handle, std::string const & name, Dispatch const & d ) const
{ {
@ -1728,7 +1698,7 @@ void VulkanHppGenerator::extendSpecialCommands( std::string const & name, bool d
{ {
cmd.insert( pos, R"( // wrapper function for command vkSetDebugUtilsObjectNameEXT, see cmd.insert( pos, R"( // wrapper function for command vkSetDebugUtilsObjectNameEXT, see
// https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectNameEXT.html // 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 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; setDebugUtilsObjectNameEXT( HandleType const & handle, std::string const & name, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
)" ); )" );
@ -1781,7 +1751,7 @@ void VulkanHppGenerator::extendSpecialCommands( std::string const & name, bool d
cmd.insert( cmd.insert(
pos, pos,
R"( // wrapper function for command vkSetDebugUtilsObjectTagEXT, see https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectTagEXT.html 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 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 Device::setDebugUtilsObjectTagEXT( HandleType const & handle, uint64_t name, TagType const & tag, Dispatch const & d ) const
{ {
@ -1801,7 +1771,7 @@ void VulkanHppGenerator::extendSpecialCommands( std::string const & name, bool d
{ {
cmd.insert( pos, R"( // wrapper function for command vkSetDebugUtilsObjectTagEXT, see cmd.insert( pos, R"( // wrapper function for command vkSetDebugUtilsObjectTagEXT, see
// https://registry.khronos.org/vulkan/specs/latest/man/html/vkSetDebugUtilsObjectTagEXT.html // 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( 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; HandleType const & handle, uint64_t name, TagType const & tag, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const;
)" ); )" );
@ -2076,7 +2046,8 @@ std::string VulkanHppGenerator::generateArgumentListEnhanced( std::vector<ParamD
} }
else if ( params[i].optional ) else if ( params[i].optional )
{ {
arguments.push_back( "Optional<" + stripPostfix( composedType, " *" ) + "> " + name + ( ( definition || withAllocators ) ? "" : " VULKAN_HPP_DEFAULT_ASSIGNMENT( nullptr )" ) ); arguments.push_back( "Optional<" + stripPostfix( composedType, " *" ) + "> " + name +
( ( definition || withAllocators ) ? "" : " VULKAN_HPP_DEFAULT_ASSIGNMENT( nullptr )" ) );
hasDefaultAssignment = true; hasDefaultAssignment = true;
} }
else else
@ -2094,7 +2065,8 @@ std::string VulkanHppGenerator::generateArgumentListEnhanced( std::vector<ParamD
assert( params[i].type.type == "char" ); assert( params[i].type.type == "char" );
if ( params[i].optional ) if ( params[i].optional )
{ {
arguments.push_back( "Optional<const std::string> " + name + ( ( definition || withAllocators ) ? "" : " VULKAN_HPP_DEFAULT_ASSIGNMENT( nullptr )" ) ); arguments.push_back( "Optional<const std::string> " + name +
( ( definition || withAllocators ) ? "" : " VULKAN_HPP_DEFAULT_ASSIGNMENT( nullptr )" ) );
hasDefaultAssignment = true; hasDefaultAssignment = true;
} }
else else
@ -3293,7 +3265,7 @@ std::string VulkanHppGenerator::generateCommandEnhanced( std::string const &
std::string const functionTemplate = std::string const functionTemplate =
R"( // wrapper function for command ${vkCommandName}, see https://registry.khronos.org/vulkan/specs/latest/man/html/${vkCommandName}.html 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} ${nodiscard}VULKAN_HPP_INLINE ${decoratedReturnType} ${className}${classSeparator}${commandName}( ${argumentList} )${const}${noexcept}
{ {
VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION );
@ -3336,7 +3308,7 @@ ${vectorSizeCheck}
{ {
std::string const functionTemplate = std::string const functionTemplate =
R"( // wrapper function for command ${vkCommandName}, see https://registry.khronos.org/vulkan/specs/latest/man/html/${vkCommandName}.html 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};)"; ${nodiscard}${decoratedReturnType} ${commandName}( ${argumentList} )${const}${noexcept};)";
return replaceWithMap( functionTemplate, return replaceWithMap( functionTemplate,
@ -4487,7 +4459,7 @@ std::string
std::string const functionTemplate = std::string const functionTemplate =
R"( // wrapper function for command ${vkCommandName}, see https://registry.khronos.org/vulkan/specs/latest/man/html/${vkCommandName}.html 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 ${nodiscard}VULKAN_HPP_INLINE ${returnType} ${className}${classSeparator}${commandName}( ${argumentList} )${const} VULKAN_HPP_NOEXCEPT
{ {
VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION );
@ -4509,7 +4481,7 @@ std::string
{ {
std::string const functionTemplate = std::string const functionTemplate =
R"( // wrapper function for command ${vkCommandName}, see https://registry.khronos.org/vulkan/specs/latest/man/html/${vkCommandName}.html 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;)"; ${nodiscard}${returnType} ${commandName}( ${argumentList} VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT )${const} VULKAN_HPP_NOEXCEPT;)";
return replaceWithMap( functionTemplate, return replaceWithMap( functionTemplate,
@ -5509,6 +5481,7 @@ std::string VulkanHppGenerator::generateCppModuleUsings() const
#endif /*VK_NO_PROTOTYPES*/ #endif /*VK_NO_PROTOTYPES*/
using VULKAN_HPP_NAMESPACE::detail::createResultValueType; using VULKAN_HPP_NAMESPACE::detail::createResultValueType;
using VULKAN_HPP_NAMESPACE::detail::resultCheck; using VULKAN_HPP_NAMESPACE::detail::resultCheck;
using VULKAN_HPP_NAMESAPCE::detail::isDispatchLoader;
} }
#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) #if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE )
namespace VULKAN_HPP_RAII_NAMESPACE namespace VULKAN_HPP_RAII_NAMESPACE
@ -6799,7 +6772,14 @@ ${deviceCommandAssignments}
static DynamicLoader dl; static DynamicLoader dl;
init(instance, device, 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::string commandMembers, deviceCommandAssignments, initialCommandAssignments, instanceCommandAssignments;
std::set<std::string> listedCommands; // some commands are listed with more than one extension! std::set<std::string> listedCommands; // some commands are listed with more than one extension!
@ -6902,6 +6882,12 @@ std::string VulkanHppGenerator::generateDispatchLoaderStatic() const
${commands} ${commands}
}; };
template <>
struct isDispatchLoader<DispatchLoaderStatic>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true;
};
inline DispatchLoaderStatic & getDispatchLoaderStatic() inline DispatchLoaderStatic & getDispatchLoaderStatic()
{ {
static DispatchLoaderStatic dls; static DispatchLoaderStatic dls;
@ -15353,7 +15339,6 @@ void VulkanHppGenerator::readRegistry( tinyxml2::XMLElement const * element )
// for all api but vulkanbase, we merge the internal features into the normal ones // for all api but vulkanbase, we merge the internal features into the normal ones
mergeInternalFeatures(); mergeInternalFeatures();
} }
distributeEnumExtends();
distributeEnumValueAliases(); distributeEnumValueAliases();
distributeStructAliases(); distributeStructAliases();
distributeRequirements(); distributeRequirements();
@ -15472,19 +15457,15 @@ void VulkanHppGenerator::readRequireEnum(
protect = getProtectFromPlatform( platform ); protect = getProtectFromPlatform( platform );
} }
auto extendIt = m_enumExtends.insert( { extends, {} } ).first; auto typeIt = m_types.find( extends );
auto eedIt = std::ranges::find_if( extendIt->second, [&name]( auto const & eed ) { return eed.name == name; } ); checkForError( typeIt != m_types.end(), line, "enum value <" + name + "> extends unknown type <" + extends + ">" );
if ( eedIt == extendIt->second.end() ) checkForError( typeIt->second.category == TypeCategory::Enum, line, "enum value <" + name + "> extends non-enum type <" + extends + ">" );
{ typeIt->second.requiredBy.insert( requiredBy );
extendIt->second.push_back( { alias, api, name, protect, { requiredBy }, supported, line } ); auto enumIt = findByNameOrAlias( m_enums, extends );
} assert( enumIt != m_enums.end() );
else checkForError( enumIt->second.addEnumAlias( line, name, alias, protect, supported ),
{ line,
checkForError( ( eedIt->alias == alias ) && ( eedIt->api == api ) && ( eedIt->protect == protect ) && ( eedIt->supported == supported ), "enum value alias <" + name + "> already listed with different properties" );
line,
"extending enum <" + extends + "> with already listed value <" + name + "> but different properties" );
eedIt->requiredBy.insert( requiredBy );
}
} }
} }
else else
@ -15743,7 +15724,9 @@ void VulkanHppGenerator::readSPIRVCapabilityEnable( tinyxml2::XMLElement const *
const auto enumIt = m_enums.find( bitmaskIt->second.require ); const auto enumIt = m_enums.find( bitmaskIt->second.require );
checkForError( checkForError(
enumIt != m_enums.end(), line, "member <" + member + "> specified for SPIR-V capability requires an unknown enum <" + bitmaskIt->second.require + ">" ); enumIt != m_enums.end(), line, "member <" + member + "> specified for SPIR-V capability requires an unknown enum <" + bitmaskIt->second.require + ">" );
checkForError( containsName( enumIt->second.values, value ), line, "unknown attribute value <" + value + "> specified for SPIR-V capability" ); checkForError( containsByName( enumIt->second.values, value ) || containsByName( enumIt->second.valueAliases, value ),
line,
"unknown attribute value <" + value + "> specified for SPIR-V capability" );
} }
} }
else if ( attributes.contains( "struct" ) ) else if ( attributes.contains( "struct" ) )
@ -17419,6 +17402,10 @@ bool VulkanHppGenerator::EnumData::addEnumAlias( int line, std::string const & n
{ {
valueAliases.push_back( { alias, name, protect, supported, line } ); valueAliases.push_back( { alias, name, protect, supported, line } );
} }
else
{
ok = ( ( aliasIt->alias == alias ) && ( aliasIt->protect == protect ) && ( aliasIt->supported == supported ) );
}
return ok; return ok;
} }
@ -17450,6 +17437,12 @@ bool VulkanHppGenerator::EnumData::addEnumValue(
namespace namespace
{ {
template <typename T>
bool containsByName( std::vector<T> const & values, std::string const & name )
{
return std::ranges::any_of( values, [&name]( T const & value ) { return value.name == name; } );
}
std::vector<std::pair<std::string, size_t>> filterNumbers( std::vector<std::string> const & names ) std::vector<std::pair<std::string, size_t>> filterNumbers( std::vector<std::string> const & names )
{ {
std::vector<std::pair<std::string, size_t>> filteredNames; std::vector<std::pair<std::string, size_t>> filteredNames;

View File

@ -600,7 +600,6 @@ private:
std::string determineSubStruct( std::pair<std::string, StructData> const & structure ) const; std::string determineSubStruct( std::pair<std::string, StructData> const & structure ) const;
std::map<size_t, VectorParamData> determineVectorParams( std::vector<ParamData> const & params ) const; std::map<size_t, VectorParamData> determineVectorParams( std::vector<ParamData> const & params ) const;
std::set<size_t> determineVoidPointerParams( std::vector<ParamData> const & params ) const; std::set<size_t> determineVoidPointerParams( std::vector<ParamData> const & params ) const;
void distributeEnumExtends();
void distributeEnumValueAliases(); void distributeEnumValueAliases();
void distributeRequirements(); void distributeRequirements();
void distributeRequirements( std::vector<RequireData> const & requireData, std::string const & requiredBy ); void distributeRequirements( std::vector<RequireData> const & requireData, std::string const & requiredBy );
@ -1266,27 +1265,26 @@ private:
MemberData const & vectorMemberByStructure( std::string const & structureType ) const; MemberData const & vectorMemberByStructure( std::string const & structureType ) const;
private: private:
std::string m_api; std::string m_api;
std::map<std::string, BaseTypeData> m_baseTypes; std::map<std::string, BaseTypeData> m_baseTypes;
std::map<std::string, BitmaskData> m_bitmasks; std::map<std::string, BitmaskData> m_bitmasks;
std::set<std::string> m_commandQueues; std::set<std::string> m_commandQueues;
std::map<std::string, CommandData> m_commands; std::map<std::string, CommandData> m_commands;
std::map<std::string, ConstantData> m_constants; std::map<std::string, ConstantData> m_constants;
std::map<std::string, DefineData> m_defines; std::map<std::string, DefineData> m_defines;
DefinesPartition m_definesPartition; // partition defined macros into mutually-exclusive sets of callees, callers, and values DefinesPartition m_definesPartition; // partition defined macros into mutually-exclusive sets of callees, callers, and values
std::map<std::string, std::vector<EnumExtendData>> m_enumExtends; std::map<std::string, EnumData> m_enums;
std::map<std::string, EnumData> m_enums; std::vector<ExtensionData> m_extensions;
std::vector<ExtensionData> m_extensions; std::map<std::string, ExternalTypeData> m_externalTypes;
std::map<std::string, ExternalTypeData> m_externalTypes; std::vector<FeatureData> m_features;
std::vector<FeatureData> m_features; std::map<std::string, FormatData> m_formats;
std::map<std::string, FormatData> m_formats; std::map<std::string, FuncPointerData> m_funcPointers;
std::map<std::string, FuncPointerData> m_funcPointers; std::map<std::string, HandleData> m_handles;
std::map<std::string, HandleData> m_handles; std::map<std::string, IncludeData> m_includes;
std::map<std::string, IncludeData> m_includes; std::map<std::string, PlatformData> m_platforms;
std::map<std::string, PlatformData> m_platforms; std::set<std::string> m_RAIISpecialFunctions;
std::set<std::string> m_RAIISpecialFunctions; std::map<std::string, SpirVCapabilityData> m_spirVCapabilities;
std::map<std::string, SpirVCapabilityData> m_spirVCapabilities; std::map<std::string, StructData> m_structs;
std::map<std::string, StructData> m_structs;
std::vector<std::pair<std::string, NameLine>> m_structsAliases; // temporary storage for aliases, as they might be listed before the actual struct is listed std::vector<std::pair<std::string, NameLine>> m_structsAliases; // temporary storage for aliases, as they might be listed before the actual struct is listed
std::map<std::string, NameLine> m_syncAccesses; std::map<std::string, NameLine> m_syncAccesses;
std::map<std::string, NameLine> m_syncStages; std::map<std::string, NameLine> m_syncStages;

View File

@ -20,3 +20,10 @@
bool m_valid = true; bool m_valid = true;
#endif #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" # pragma clang diagnostic ignored "-Wcast-function-type"
# endif # endif
template <typename HandleType> template <typename HandleType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class ObjectDestroyShared class ObjectDestroyShared
{ {
public: public:
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType; using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
template <class Dispatcher>
using DestroyFunctionPointerType = using DestroyFunctionPointerType =
typename std::conditional<HasDestructor<HandleType>::value, typename std::conditional<HasDestructor<HandleType>::value,
void ( DestructorType::* )( HandleType, const AllocationCallbacks *, const Dispatcher & ) const, 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; 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 ), ObjectDestroyShared( Optional<const AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ASSIGNMENT( nullptr ),
const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) 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_dispatch( &dispatch )
, m_allocationCallbacks( allocationCallbacks ) , m_allocationCallbacks( allocationCallbacks )
{ {
@ -356,24 +354,22 @@ namespace VULKAN_HPP_NAMESPACE
} }
private: private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr; DestroyFunctionPointerType m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr; const Dispatcher * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr; Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
}; };
template <typename HandleType> template <typename HandleType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class ObjectFreeShared class ObjectFreeShared
{ {
public: public:
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType; using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
template <class Dispatcher>
using DestroyFunctionPointerType = void ( DestructorType::* )( HandleType, const AllocationCallbacks *, const Dispatcher & ) const; 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 ), ObjectFreeShared( Optional<const AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ASSIGNMENT( nullptr ),
const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) 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_dispatch( &dispatch )
, m_allocationCallbacks( allocationCallbacks ) , m_allocationCallbacks( allocationCallbacks )
{ {
@ -387,23 +383,21 @@ namespace VULKAN_HPP_NAMESPACE
} }
private: private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr; DestroyFunctionPointerType m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr; const Dispatcher * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr; Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
}; };
template <typename HandleType> template <typename HandleType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class ObjectReleaseShared class ObjectReleaseShared
{ {
public: public:
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType; using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
template <class Dispatcher>
using DestroyFunctionPointerType = void ( DestructorType::* )( HandleType, const Dispatcher & ) const; 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 ) 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 ) , m_dispatch( &dispatch )
{ {
} }
@ -416,11 +410,11 @@ namespace VULKAN_HPP_NAMESPACE
} }
private: private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr; DestroyFunctionPointerType m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = 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 class PoolFreeShared
{ {
public: public:
@ -428,17 +422,14 @@ namespace VULKAN_HPP_NAMESPACE
using PoolTypeExport = PoolType; using PoolTypeExport = PoolType;
template <class Dispatcher>
using ReturnType = decltype( std::declval<DestructorType>().free( PoolType(), 0u, nullptr, Dispatcher() ) ); using ReturnType = decltype( std::declval<DestructorType>().free( PoolType(), 0u, nullptr, Dispatcher() ) );
template <class Dispatcher> using DestroyFunctionPointerType = ReturnType( DestructorType::* )( PoolType, uint32_t, const HandleType *, const Dispatcher & ) const;
using DestroyFunctionPointerType = ReturnType<Dispatcher> ( DestructorType::* )( PoolType, uint32_t, const HandleType *, const Dispatcher & ) const;
PoolFreeShared() = default; PoolFreeShared() = default;
template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
PoolFreeShared( SharedHandle<PoolType> pool, const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) 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_dispatch( &dispatch )
, m_pool( std::move( pool ) ) , m_pool( std::move( pool ) )
{ {
@ -452,9 +443,9 @@ namespace VULKAN_HPP_NAMESPACE
} }
private: private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr; DestroyFunctionPointerType m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr; const Dispatcher * m_dispatch = nullptr;
SharedHandle<PoolType> m_pool{}; SharedHandle<PoolType> m_pool{};
}; };
# if defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __INTEL_COMPILER ) # if defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __INTEL_COMPILER )

View File

@ -52,6 +52,7 @@ export namespace VULKAN_HPP_NAMESPACE
using VULKAN_HPP_NAMESPACE::detail::DispatchLoaderStatic; using VULKAN_HPP_NAMESPACE::detail::DispatchLoaderStatic;
using VULKAN_HPP_NAMESPACE::detail::getDispatchLoaderStatic; using VULKAN_HPP_NAMESPACE::detail::getDispatchLoaderStatic;
#endif /*VK_NO_PROTOTYPES*/ #endif /*VK_NO_PROTOTYPES*/
using VULKAN_HPP_NAMESAPCE::detail::isDispatchLoader;
using VULKAN_HPP_NAMESPACE::detail::createResultValueType; using VULKAN_HPP_NAMESPACE::detail::createResultValueType;
using VULKAN_HPP_NAMESPACE::detail::resultCheck; using VULKAN_HPP_NAMESPACE::detail::resultCheck;
} // namespace detail } // namespace detail

View File

@ -150,7 +150,7 @@ namespace VULKAN_HPP_NAMESPACE
private: private:
VULKAN_HPP_CONSTEXPR_14 void copy( char const * data, size_t len ) VULKAN_HPP_NOEXCEPT VULKAN_HPP_CONSTEXPR_14 void copy( char const * data, size_t len ) VULKAN_HPP_NOEXCEPT
{ {
size_t n = (std::min)( N - 1, len ); size_t n = ( std::min )( N - 1, len );
for ( size_t i = 0; i < n; ++i ) for ( size_t i = 0; i < n; ++i )
{ {
( *this )[i] = data[i]; ( *this )[i] = data[i];
@ -1023,6 +1023,12 @@ namespace VULKAN_HPP_NAMESPACE
#endif #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 ) ) #if !defined( VK_NO_PROTOTYPES ) || ( defined( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC ) && ( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 0 ) )
class DispatchLoaderStatic : public DispatchLoaderBase 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() inline DispatchLoaderStatic & getDispatchLoaderStatic()
{ {
static DispatchLoaderStatic dls; static DispatchLoaderStatic dls;
@ -24151,6 +24163,13 @@ namespace VULKAN_HPP_NAMESPACE
init( instance, device, dl ); init( instance, device, dl );
} }
}; };
template <>
struct isDispatchLoader<DispatchLoaderDynamic>
{
static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true;
};
} // namespace detail } // namespace detail
} // namespace VULKAN_HPP_NAMESPACE } // namespace VULKAN_HPP_NAMESPACE
#endif #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" # pragma clang diagnostic ignored "-Wcast-function-type"
# endif # endif
template <typename HandleType> template <typename HandleType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class ObjectDestroyShared class ObjectDestroyShared
{ {
public: public:
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType; using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
template <class Dispatcher>
using DestroyFunctionPointerType = using DestroyFunctionPointerType =
typename std::conditional<HasDestructor<HandleType>::value, typename std::conditional<HasDestructor<HandleType>::value,
void ( DestructorType::* )( HandleType, const AllocationCallbacks *, const Dispatcher & ) const, 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; 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 ), ObjectDestroyShared( Optional<const AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ASSIGNMENT( nullptr ),
const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) 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_dispatch( &dispatch )
, m_allocationCallbacks( allocationCallbacks ) , m_allocationCallbacks( allocationCallbacks )
{ {
@ -360,24 +358,22 @@ namespace VULKAN_HPP_NAMESPACE
} }
private: private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr; DestroyFunctionPointerType m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr; const Dispatcher * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr; Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
}; };
template <typename HandleType> template <typename HandleType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class ObjectFreeShared class ObjectFreeShared
{ {
public: public:
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType; using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
template <class Dispatcher>
using DestroyFunctionPointerType = void ( DestructorType::* )( HandleType, const AllocationCallbacks *, const Dispatcher & ) const; 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 ), ObjectFreeShared( Optional<const AllocationCallbacks> allocationCallbacks VULKAN_HPP_DEFAULT_ASSIGNMENT( nullptr ),
const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) 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_dispatch( &dispatch )
, m_allocationCallbacks( allocationCallbacks ) , m_allocationCallbacks( allocationCallbacks )
{ {
@ -391,24 +387,21 @@ namespace VULKAN_HPP_NAMESPACE
} }
private: private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr; DestroyFunctionPointerType m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr; const Dispatcher * m_dispatch = nullptr;
Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr; Optional<const AllocationCallbacks> m_allocationCallbacks = nullptr;
}; };
template <typename HandleType> template <typename HandleType, typename Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
class ObjectReleaseShared class ObjectReleaseShared
{ {
public: public:
using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType; using DestructorType = typename SharedHandleTraits<HandleType>::DestructorType;
template <class Dispatcher>
using DestroyFunctionPointerType = void ( DestructorType::* )( HandleType, const Dispatcher & ) const; 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 ) 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 )
, m_dispatch( &dispatch )
{ {
} }
@ -420,11 +413,11 @@ namespace VULKAN_HPP_NAMESPACE
} }
private: private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr; DestroyFunctionPointerType m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = 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 class PoolFreeShared
{ {
public: public:
@ -432,17 +425,14 @@ namespace VULKAN_HPP_NAMESPACE
using PoolTypeExport = PoolType; using PoolTypeExport = PoolType;
template <class Dispatcher>
using ReturnType = decltype( std::declval<DestructorType>().free( PoolType(), 0u, nullptr, Dispatcher() ) ); using ReturnType = decltype( std::declval<DestructorType>().free( PoolType(), 0u, nullptr, Dispatcher() ) );
template <class Dispatcher> using DestroyFunctionPointerType = ReturnType ( DestructorType::* )( PoolType, uint32_t, const HandleType *, const Dispatcher & ) const;
using DestroyFunctionPointerType = ReturnType<Dispatcher> ( DestructorType::* )( PoolType, uint32_t, const HandleType *, const Dispatcher & ) const;
PoolFreeShared() = default; PoolFreeShared() = default;
template <class Dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE>
PoolFreeShared( SharedHandle<PoolType> pool, const Dispatcher & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) 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_dispatch( &dispatch )
, m_pool( std::move( pool ) ) , m_pool( std::move( pool ) )
{ {
@ -456,9 +446,9 @@ namespace VULKAN_HPP_NAMESPACE
} }
private: private:
DestroyFunctionPointerType<detail::DispatchLoaderBase> m_destroy = nullptr; DestroyFunctionPointerType m_destroy = nullptr;
const detail::DispatchLoaderBase * m_dispatch = nullptr; const Dispatcher * m_dispatch = nullptr;
SharedHandle<PoolType> m_pool{}; SharedHandle<PoolType> m_pool{};
}; };
# if defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __INTEL_COMPILER ) # if defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __INTEL_COMPILER )