Blender  V3.3
COM_CPUDevice.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. */
3 
4 #include "COM_CPUDevice.h"
5 
6 #include "COM_ExecutionGroup.h"
7 #include "COM_NodeOperation.h"
8 
9 namespace blender::compositor {
10 
12 {
13 }
14 
15 void CPUDevice::execute(WorkPackage *work_package)
16 {
17  switch (work_package->type) {
19  const unsigned int chunk_number = work_package->chunk_number;
20  ExecutionGroup *execution_group = work_package->execution_group;
21 
22  execution_group->get_output_operation()->execute_region(&work_package->rect, chunk_number);
23  execution_group->finalize_chunk_execution(chunk_number, nullptr);
24  break;
25  }
27  work_package->execute_fn();
28  break;
29  }
30  }
31 
32  if (work_package->executed_fn) {
33  work_package->executed_fn();
34  }
35 }
36 
37 } // namespace blender::compositor
void execute(WorkPackage *work) override
execute a WorkPackage
Class ExecutionGroup is a group of Operations that are executed as one. This grouping is used to comb...
void finalize_chunk_execution(int chunk_number, MemoryBuffer **memory_buffers)
after a chunk is executed the needed resources can be freed or unlocked.
NodeOperation * get_output_operation() const
get the output operation of this ExecutionGroup
virtual void execute_region(rcti *, unsigned int)
when a chunk is executed by a CPUDevice, this method is called
@ CustomFunction
Executes a custom function.
@ Tile
Executes an execution group tile.
contains data about work that can be scheduled
std::function< void()> executed_fn
unsigned int chunk_number
number of the chunk to be executed
std::function< void()> execute_fn
ExecutionGroup * execution_group
execution_group with the operations-setup to be evaluated