Blender
V5.3
source
blender
depsgraph
intern
depsgraph_writeback_sync.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2024 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9
#include <mutex>
10
11
#include "
DEG_depsgraph.hh
"
12
#include "
DEG_depsgraph_writeback_sync.hh
"
13
14
#include "
depsgraph.hh
"
15
16
namespace
blender::deg::sync_writeback
{
17
18
void
add
(blender::Depsgraph &depsgraph, std::function<
void
()>
fn
)
19
{
20
deg::Depsgraph
°_graph =
reinterpret_cast<
deg::Depsgraph
&
>
(depsgraph);
21
if
(!deg_graph.
is_active
|| deg_graph.
sync_writeback
==
DEG_EVALUATE_SYNC_WRITEBACK_NO
) {
22
return
;
23
}
24
25
std::lock_guard
lock
{deg_graph.
sync_writeback_callbacks_mutex
};
26
deg_graph.
sync_writeback_callbacks
.append(std::move(
fn
));
27
}
28
29
}
// namespace blender::deg::sync_writeback
DEG_depsgraph.hh
DEG_depsgraph_writeback_sync.hh
lock
volatile int lock
Definition
atomic_ops_unix.h:0
depsgraph.hh
blender::deg::sync_writeback
Definition
DEG_depsgraph_writeback_sync.hh:24
blender::deg::sync_writeback::add
void add(Depsgraph &depsgraph, std::function< void()> fn)
blender::fn
Definition
BKE_attribute.hh:30
blender::DEG_EVALUATE_SYNC_WRITEBACK_NO
@ DEG_EVALUATE_SYNC_WRITEBACK_NO
Definition
DEG_depsgraph.hh:179
blender::deg::Depsgraph
Definition
depsgraph.hh:50
blender::deg::Depsgraph::sync_writeback_callbacks_mutex
Mutex sync_writeback_callbacks_mutex
Definition
depsgraph.hh:200
blender::deg::Depsgraph::sync_writeback_callbacks
Vector< std::function< void()> > sync_writeback_callbacks
Definition
depsgraph.hh:198
blender::deg::Depsgraph::is_active
bool is_active
Definition
depsgraph.hh:163
blender::deg::Depsgraph::sync_writeback
DepsgraphEvaluateSyncWriteback sync_writeback
Definition
depsgraph.hh:193
Generated on
for Blender by
doxygen
1.18.0