Skip to content

Commit

Permalink
Add check on <syncstage> <syncsupport> "queues" being specified with …
Browse files Browse the repository at this point in the history
…at least one command. (#1968)
  • Loading branch information
asuessenbach authored Oct 8, 2024
1 parent b8e4e70 commit 00dac1b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
17 changes: 14 additions & 3 deletions VulkanHppGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13340,7 +13340,7 @@ void VulkanHppGenerator::readCommand( tinyxml2::XMLElement const * element )
{ "cmdbufferlevel", { "primary", "secondary" } },
{ "comment", {} },
{ "errorcodes", {} },
{ "queues", { "compute", "decode", "encode", "graphics", "opticalflow", "sparse_binding", "transfer" } },
{ "queues", {} },
{ "renderpass", { "both", "inside", "outside" } },
{ "successcodes", {} },
{ "tasks", { "action", "indirection", "state", "synchronization" } },
Expand All @@ -13363,6 +13363,10 @@ void VulkanHppGenerator::readCommand( tinyxml2::XMLElement const * element )
commandData.errorCodes = tokenize( attribute.second, "," );
// errorCodes are checked in checkCorrectness after complete reading
}
else if ( attribute.first == "queues" )
{
m_commandQueues.insert( attribute.second );
}
else if ( attribute.first == "successcodes" )
{
commandData.successCodes = tokenize( attribute.second, "," );
Expand Down Expand Up @@ -15267,9 +15271,16 @@ void VulkanHppGenerator::readSyncStageEquivalent( tinyxml2::XMLElement const * e

void VulkanHppGenerator::readSyncStageSupport( tinyxml2::XMLElement const * element )
{
const int line = element->GetLineNum();
checkAttributes( line, getAttributes( element ), { { "queues", { "compute", "decode", "encode", "graphics", "opticalflow", "transfer" } } }, {} );
const int line = element->GetLineNum();
std::map<std::string, std::string> attributes = getAttributes( element );
checkAttributes( line, attributes, { { "queues", {} } }, {} );
checkElements( line, getChildElements( element ), {}, {} );

for ( auto const & attribute : attributes )
{
assert( attribute.first == "queues" );
checkForError( m_commandQueues.contains( attribute.second ), line, "syncsupport queues uses unknown value <" + attribute.second + ">" );
}
}

void VulkanHppGenerator::readTag( tinyxml2::XMLElement const * element )
Expand Down
4 changes: 2 additions & 2 deletions VulkanHppGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,8 +1102,7 @@ class VulkanHppGenerator
void readSPIRVExtensions( tinyxml2::XMLElement const * element );
void readStructMember( tinyxml2::XMLElement const * element, std::vector<MemberData> & members, bool isUnion );
void readSync( tinyxml2::XMLElement const * element );
void readSyncAccess( tinyxml2::XMLElement const * element,
std::map<std::string, EnumData>::const_iterator accessFlagBits2It );
void readSyncAccess( tinyxml2::XMLElement const * element, std::map<std::string, EnumData>::const_iterator accessFlagBits2It );
void readSyncAccessEquivalent( tinyxml2::XMLElement const * element, std::map<std::string, EnumData>::const_iterator accessFlagBits2It );
void readSyncAccessSupport( tinyxml2::XMLElement const * element );
void readSyncPipeline( tinyxml2::XMLElement const * element );
Expand Down Expand Up @@ -1151,6 +1150,7 @@ class VulkanHppGenerator
std::string m_api;
std::map<std::string, BaseTypeData> m_baseTypes;
std::map<std::string, BitmaskData> m_bitmasks;
std::set<std::string> m_commandQueues;
std::map<std::string, CommandData> m_commands;
std::map<std::string, ConstantData> m_constants;
std::map<std::string, DefineData> m_defines;
Expand Down

0 comments on commit 00dac1b

Please sign in to comment.