119 int num_work_threads_;
136 const char *view_name,
166 void execute_work(
const rcti &work_rect, std::function<
void(
const rcti &split_rect)> work_func);
172 template<
typename TResult>
174 std::function<TResult(
const rcti &split_rect)> work_func,
176 std::function<
void(TResult &join,
const TResult &chunk)> reduce_func)
182 chunks[current] = work_func(split_rect);
185 reduce_func(join, chunks[i]);
195#ifdef WITH_CXX_GUARDEDALLOC
196 MEM_CXX_CLASS_ALLOC_FUNCS(
"COM:ExecutionSystem")
pthread_cond_t ThreadCondition
pthread_mutex_t ThreadMutex
Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operatio...
ATOMIC_INLINE int32_t atomic_fetch_and_add_int32(int32_t *p, int32_t x)
Overall context of the compositor.
the ExecutionSystem contains the whole compositor tree.
const CompositorContext & get_context() const
get the reference to the compositor context
void set_operations(Span< NodeOperation * > operations)
void execute()
execute this system
ExecutionSystem(RenderData *rd, Scene *scene, bNodeTree *editingtree, bool rendering, const char *view_name, realtime_compositor::RenderContext *render_context, realtime_compositor::Profiler *profiler)
Create a new ExecutionSystem and initialize it with the editingtree.
void execute_work(const rcti &work_rect, std::function< TResult(const rcti &split_rect)> work_func, TResult &join, std::function< void(TResult &join, const TResult &chunk)> reduce_func)
void execute_work(const rcti &work_rect, std::function< void(const rcti &split_rect)> work_func)