mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2025-09-09 20:09:49 -04:00
Add support for newly introduced attributes. (#2177)
This commit is contained in:
parent
ad71cabe2c
commit
81b2f2f950
@ -2002,8 +2002,7 @@ void VulkanHppGenerator::distributeEnumExtends()
|
|||||||
{
|
{
|
||||||
typeIt->second.requiredBy.insert( requiredBy );
|
typeIt->second.requiredBy.insert( requiredBy );
|
||||||
}
|
}
|
||||||
checkForError( enumIt->second.addEnumAlias(
|
checkForError( enumIt->second.addEnumAlias( eed.xmlLine, eed.name, eed.alias, eed.protect, ( eed.api.empty() || ( eed.api == m_api ) ) && eed.supported ),
|
||||||
eed.xmlLine, eed.name, eed.alias, getProtectFromPlatform( eed.platform ), ( eed.api.empty() || ( eed.api == m_api ) ) && eed.supported ),
|
|
||||||
eed.xmlLine,
|
eed.xmlLine,
|
||||||
"enum value alias <" + eed.name + "> already listed with different properties" );
|
"enum value alias <" + eed.name + "> already listed with different properties" );
|
||||||
}
|
}
|
||||||
@ -7738,7 +7737,7 @@ std::string VulkanHppGenerator::generateFormatTraits() const
|
|||||||
auto noPredicate = []( auto const & ) { return true; };
|
auto noPredicate = []( auto const & ) { return true; };
|
||||||
|
|
||||||
auto generateAllFormatsList = [&]( auto const formatIt ) { return generateFormatTraitsList( formatIt->second, noPredicate ); };
|
auto generateAllFormatsList = [&]( auto const formatIt ) { return generateFormatTraitsList( formatIt->second, noPredicate ); };
|
||||||
auto generateAlphaCases = [this]( auto const formatIt )
|
auto generateAlphaCases = [this]( auto const formatIt )
|
||||||
{
|
{
|
||||||
return generateFormatTraitsCases(
|
return generateFormatTraitsCases(
|
||||||
formatIt->second,
|
formatIt->second,
|
||||||
@ -13719,7 +13718,8 @@ void VulkanHppGenerator::readCommand( tinyxml2::XMLElement const * element )
|
|||||||
checkAttributes( line,
|
checkAttributes( line,
|
||||||
attributes,
|
attributes,
|
||||||
{},
|
{},
|
||||||
{ { "api", { "vulkan", "vulkansc" } },
|
{ { "allownoqueues", { "true" } },
|
||||||
|
{ "api", { "vulkan", "vulkansc" } },
|
||||||
{ "cmdbufferlevel", { "primary", "secondary" } },
|
{ "cmdbufferlevel", { "primary", "secondary" } },
|
||||||
{ "comment", {} },
|
{ "comment", {} },
|
||||||
{ "errorcodes", {} },
|
{ "errorcodes", {} },
|
||||||
@ -15152,9 +15152,13 @@ void VulkanHppGenerator::readRequireEnum(
|
|||||||
checkAttributes( line,
|
checkAttributes( line,
|
||||||
attributes,
|
attributes,
|
||||||
{ { "alias", {} }, { "name", {} } },
|
{ { "alias", {} }, { "name", {} } },
|
||||||
{ { "api", { "vulkan", "vulkansc" } }, { "comment", {} }, { "deprecated", { "aliased" } }, { "extends", {} } } );
|
{ { "api", { "vulkan", "vulkansc" } },
|
||||||
|
{ "comment", {} },
|
||||||
|
{ "deprecated", { "aliased" } },
|
||||||
|
{ "extends", {} },
|
||||||
|
{ "protect", { "VK_ENABLE_BETA_EXTENSIONS" } } } );
|
||||||
|
|
||||||
std::string alias, api, extends, name;
|
std::string alias, api, extends, name, protect;
|
||||||
for ( auto const & attribute : attributes )
|
for ( auto const & attribute : attributes )
|
||||||
{
|
{
|
||||||
if ( attribute.first == "alias" )
|
if ( attribute.first == "alias" )
|
||||||
@ -15173,10 +15177,16 @@ void VulkanHppGenerator::readRequireEnum(
|
|||||||
{
|
{
|
||||||
name = attribute.second;
|
name = attribute.second;
|
||||||
}
|
}
|
||||||
|
else if ( attribute.first == "protect" )
|
||||||
|
{
|
||||||
|
protect = attribute.second;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( extends.empty() )
|
if ( extends.empty() )
|
||||||
{
|
{
|
||||||
|
checkForError( protect.empty(), line, "protect <" + protect + "> of enum alias <" + alias + "> with empty <extends> is not expected" );
|
||||||
|
|
||||||
// enum aliases that don't extend something are listed as constants
|
// enum aliases that don't extend something are listed as constants
|
||||||
auto typeIt = m_types.find( alias );
|
auto typeIt = m_types.find( alias );
|
||||||
checkForError( typeIt != m_types.end(), line, "enum alias <" + name + "> is an alias of an unknown enum <" + alias + ">" );
|
checkForError( typeIt != m_types.end(), line, "enum alias <" + name + "> is an alias of an unknown enum <" + alias + ">" );
|
||||||
@ -15195,15 +15205,20 @@ void VulkanHppGenerator::readRequireEnum(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if ( protect.empty() )
|
||||||
|
{
|
||||||
|
protect = getProtectFromPlatform( platform );
|
||||||
|
}
|
||||||
|
|
||||||
auto extendIt = m_enumExtends.insert( { extends, {} } ).first;
|
auto extendIt = m_enumExtends.insert( { extends, {} } ).first;
|
||||||
auto eedIt = std::ranges::find_if( extendIt->second, [&name]( auto const & eed ) { return eed.name == name; } );
|
auto eedIt = std::ranges::find_if( extendIt->second, [&name]( auto const & eed ) { return eed.name == name; } );
|
||||||
if ( eedIt == extendIt->second.end() )
|
if ( eedIt == extendIt->second.end() )
|
||||||
{
|
{
|
||||||
extendIt->second.push_back( { alias, api, name, platform, { requiredBy }, supported, line } );
|
extendIt->second.push_back( { alias, api, name, protect, { requiredBy }, supported, line } );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
checkForError( ( eedIt->alias == alias ) && ( eedIt->api == api ) && ( eedIt->platform == platform ) && ( eedIt->supported == supported ),
|
checkForError( ( eedIt->alias == alias ) && ( eedIt->api == api ) && ( eedIt->protect == protect ) && ( eedIt->supported == supported ),
|
||||||
line,
|
line,
|
||||||
"extending enum <" + extends + "> with already listed value <" + name + "> but different properties" );
|
"extending enum <" + extends + "> with already listed value <" + name + "> but different properties" );
|
||||||
eedIt->requiredBy.insert( requiredBy );
|
eedIt->requiredBy.insert( requiredBy );
|
||||||
@ -15271,6 +15286,8 @@ void VulkanHppGenerator::readRequireEnum(
|
|||||||
|
|
||||||
if ( extends.empty() )
|
if ( extends.empty() )
|
||||||
{
|
{
|
||||||
|
checkForError( protect.empty(), line, "protect <" + protect + "> of required enum <" + name + "> with empty <extends> is not expected" );
|
||||||
|
|
||||||
if ( value.empty() )
|
if ( value.empty() )
|
||||||
{
|
{
|
||||||
auto typeIt = m_types.find( name );
|
auto typeIt = m_types.find( name );
|
||||||
|
@ -186,7 +186,7 @@ private:
|
|||||||
std::string alias = {};
|
std::string alias = {};
|
||||||
std::string api = {};
|
std::string api = {};
|
||||||
std::string name = {};
|
std::string name = {};
|
||||||
std::string platform = {};
|
std::string protect = {};
|
||||||
std::set<std::string> requiredBy = {};
|
std::set<std::string> requiredBy = {};
|
||||||
bool supported = {};
|
bool supported = {};
|
||||||
int xmlLine = {};
|
int xmlLine = {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user