Use timestamps for attribute updates (#2629)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user