rename ChunkcContainer::addChild/addSimpleChild to push/emplace (#6704)

'child' didn't make any sense in this API, push/emplace mimics
std::vector, which is closer to what the api actually does.
This commit is contained in:
Mathias Agopian
2023-04-03 14:06:42 -07:00
committed by GitHub
parent e48690bdf9
commit a484fe1de3
3 changed files with 58 additions and 49 deletions
+4 -4
View File
@@ -328,8 +328,8 @@ void ShaderIndex::writeChunks(ostream& stream) {
}
filamat::ChunkContainer cc;
const auto& dchunk = cc.addChild<DictionaryTextChunk>(std::move(lines), mDictTag);
cc.addChild<MaterialTextChunk>(std::move(mShaderRecords), dchunk.getDictionary(), mMatTag);
const auto& dchunk = cc.push<DictionaryTextChunk>(std::move(lines), mDictTag);
cc.push<MaterialTextChunk>(std::move(mShaderRecords), dchunk.getDictionary(), mMatTag);
const size_t bufSize = cc.getSize();
auto buffer = std::make_unique<uint8_t[]>(bufSize);
@@ -391,8 +391,8 @@ void BlobIndex::writeChunks(ostream& stream) {
// Apply SMOL-V compression and write out the results.
filamat::ChunkContainer cc;
cc.addChild<MaterialSpirvChunk>(std::move(mShaderRecords));
cc.addChild<DictionarySpirvChunk>(std::move(blobs), false);
cc.push<MaterialSpirvChunk>(std::move(mShaderRecords));
cc.push<DictionarySpirvChunk>(std::move(blobs), false);
Flattener prepass = Flattener::getDryRunner();
initialize(prepass);