统一 2D/3D Renderable 继承链与实时数据策略

This commit is contained in:
2026-08-14 18:47:36 +08:00
parent bb64801679
commit cb32f72bc9
43 changed files with 1010 additions and 528 deletions
@@ -74,14 +74,17 @@ void Renderable_Base::Impl::rebuild_render_graph() {
}
void Renderable_Base::Impl::reset_render_graph() noexcept {
std::lock_guard lock(render_graph_mutex);
render_graph.reset();
invalidate_prepare();
}
std::shared_ptr<const Renderable_Graph>
Renderable_Base::Impl::render_graph_snapshot() {
std::lock_guard lock(render_graph_mutex);
if (!render_graph) {
std::unordered_map<std::string, Render_Node_Id> next_identities;
std::pmr::unordered_map<std::string, Render_Node_Id> next_identities{
&memory_resource()};
Renderable_Graph_Builder builder(
renderable_id,
[this, &next_identities](std::string_view key) {
@@ -101,7 +104,8 @@ Renderable_Base::Impl::render_graph_snapshot() {
build_paint_graph(builder);
render_graph = std::make_shared<Renderable_Graph>(
std::move(builder).finish());
node_identities = std::move(next_identities);
node_identities.clear();
node_identities.insert(next_identities.begin(), next_identities.end());
}
return render_graph;
}