Maximum optimization inserts using reserve() for operands

This commit is contained in:
Herman Semenov 2024-04-01 19:51:29 +03:00 committed by arcady-lunarg
parent d52749714a
commit 2db79056b4
3 changed files with 98 additions and 6 deletions

View file

@ -2007,8 +2007,9 @@ void TGlslangToSpvTraverser::finishSpv(bool compileOnly)
}
// finish off the entry-point SPV instruction by adding the Input/Output <id>
for (auto it = iOSet.cbegin(); it != iOSet.cend(); ++it)
entryPoint->addIdOperand(*it);
entryPoint->reserveOperands(iOSet.size());
for (auto id : iOSet)
entryPoint->addIdOperand(id);
}
// Add capabilities, extensions, remove unneeded decorations, etc.,