Removed some dead code.

This commit is contained in:
asuessenbach 2022-08-02 08:18:26 +02:00
parent f50243e683
commit 95507d1e7c
2 changed files with 2 additions and 74 deletions

View File

@ -6959,18 +6959,9 @@ std::string VulkanHppGenerator::generateRAIIHandleCommandVoid( std::map<std::str
}
else if ( commandIt->second.params[returnParams[0]].type.type == "void" )
{
switch ( vectorParams.size() )
if ( vectorParams.empty() )
{
case 0: str = generateRAIIHandleCommandEnhanced( commandIt, initialSkipCount, returnParams, vectorParams, definition, false, false ); break;
case 1:
if ( returnParams[0] == vectorParams.begin()->first )
{
if ( commandIt->first == stripPluralS( commandIt->first ) )
{
str = generateRAIIHandleCommandVoid1ReturnVoidVectorSingular( commandIt, initialSkipCount, vectorParams, returnParams[0], definition );
}
}
break;
generateRAIIHandleCommandEnhanced( commandIt, initialSkipCount, returnParams, vectorParams, definition, false, false );
}
}
else
@ -7009,64 +7000,6 @@ std::string VulkanHppGenerator::generateRAIIHandleCommandVoid( std::map<std::str
return str;
}
std::string VulkanHppGenerator::generateRAIIHandleCommandVoid1ReturnVoidVectorSingular( std::map<std::string, CommandData>::const_iterator commandIt,
size_t initialSkipCount,
std::map<size_t, size_t> const & vectorParams,
size_t returnParam,
bool definition ) const
{
std::set<size_t> skippedParams = determineSkippedParams( commandIt->second.params, initialSkipCount, vectorParams, { returnParam }, true );
std::set<size_t> singularParams = determineSingularParams( returnParam, vectorParams );
std::string argumentList = generateArgumentListEnhanced(
commandIt->second.params, { returnParam }, vectorParams, skippedParams, singularParams, { returnParam }, definition, false, false, false );
std::string commandName = generateCommandName( commandIt->first, commandIt->second.params, initialSkipCount, m_tags, true, false );
std::string argumentTemplates = generateArgumentTemplates( commandIt->second.params, { returnParam }, vectorParams, { returnParam }, false, true );
std::string dataType = stripPrefix( commandIt->second.params[returnParam].name, "p" ) + "Type";
if ( definition )
{
std::string const singularDefinitionTemplate =
R"(
${argumentTemplates}
VULKAN_HPP_NODISCARD ${dataType} ${className}::${commandName}( ${argumentList} ) const
{
${dataType} ${dataName};
getDispatcher()->${vkCommand}( ${callArguments} );
return ${dataName};
}
)";
std::string callArguments = generateCallArgumentsEnhanced( commandIt->second, initialSkipCount, false, singularParams, {}, true );
std::string dataName = startLowerCase( stripPrefix( commandIt->second.params[returnParam].name, "p" ) );
return replaceWithMap( singularDefinitionTemplate,
{ { "argumentList", argumentList },
{ "argumentTemplates", argumentTemplates },
{ "callArguments", callArguments },
{ "className", stripPrefix( commandIt->second.params[initialSkipCount - 1].type.type, "Vk" ) },
{ "commandName", commandName },
{ "dataName", dataName },
{ "dataType", dataType },
{ "vkCommand", commandIt->first } } );
}
else
{
std::string const singularDeclarationTemplate =
R"(
${argumentTemplates}
VULKAN_HPP_NODISCARD ${dataType} ${commandName}( ${argumentList} ) const;
)";
return replaceWithMap( singularDeclarationTemplate,
{
{ "argumentList", argumentList },
{ "argumentTemplates", argumentTemplates },
{ "commandName", commandName },
{ "dataType", dataType },
} );
}
}
std::pair<std::string, std::string>
VulkanHppGenerator::generateRAIIHandleConstructor( std::pair<std::string, HandleData> const & handle,
std::map<std::string, VulkanHppGenerator::CommandData>::const_iterator constructorIt,

View File

@ -738,11 +738,6 @@ private:
std::vector<size_t> const & returnParamIndices ) const;
std::string generateRAIIHandleCommandValue( std::map<std::string, CommandData>::const_iterator commandIt, size_t initialSkipCount, bool definition ) const;
std::string generateRAIIHandleCommandVoid( std::map<std::string, CommandData>::const_iterator commandIt, size_t initialSkipCount, bool definition ) const;
std::string generateRAIIHandleCommandVoid1ReturnVoidVectorSingular( std::map<std::string, CommandData>::const_iterator commandIt,
size_t initialSkipCount,
std::map<size_t, size_t> const & vectorParamIndices,
size_t returnParam,
bool definition ) const;
std::pair<std::string, std::string> generateRAIIHandleConstructor( std::pair<std::string, HandleData> const & handle,
std::map<std::string, CommandData>::const_iterator constructorIt,
std::string const & enter,