Use timestamps for attribute updates (#2629)

This commit is contained in:
Tim Sylvester
2024-08-20 07:33:29 -07:00
committed by GitHub
parent c3a2fa247c
commit fceaa18caf
43 changed files with 439 additions and 163 deletions

View File

@@ -25,6 +25,7 @@ const gfx::UniqueVertexBufferResource& VertexAttribute::getBuffer(gfx::VertexAtt
attrib.rawData.data(), attrib.rawData.size(), usage, false);
attrib.setBuffer(std::move(buffer));
attrib.setRawData({});
attrib_.setDirty(false);
} else {
assert(false);
}
@@ -33,18 +34,5 @@ const gfx::UniqueVertexBufferResource& VertexAttribute::getBuffer(gfx::VertexAtt
return attrib_.getBuffer();
}
bool VertexAttributeArray::isDirty() const {
return std::any_of(attrs.begin(), attrs.end(), [](const auto& attr) {
if (attr) {
// If we have shared data, the dirty flag from that overrides ours
const auto& attrib = static_cast<const VertexAttribute&>(*attr);
if (const auto& shared = attrib.getSharedRawData()) {
return shared->getDirty();
}
}
return attr && attr->isDirty();
});
}
} // namespace mtl
} // namespace mbgl