统一 2D/3D Renderable 继承链与实时数据策略
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user