Blender
V3.3
|
Class ExecutionGroup is a group of Operations that are executed as one. This grouping is used to combine Operations that can be executed as one whole when multi-processing. More...
#include <COM_ExecutionGroup.h>
Public Member Functions | |
ExecutionGroup (int id) | |
int | get_id () const |
const ExecutionGroupFlags | get_flags () const |
bool | add_operation (NodeOperation *operation) |
add an operation to this ExecutionGroup More... | |
void | set_output_execution_group (bool is_output) |
set whether this ExecutionGroup is an output More... | |
void | determine_resolution (unsigned int resolution[2]) |
determine the resolution of this ExecutionGroup More... | |
void | set_resolution (unsigned int resolution[2]) |
set the resolution of this executiongroup More... | |
unsigned int | get_width () const |
get the width of this execution group More... | |
unsigned int | get_height () const |
get the height of this execution group More... | |
NodeOperation * | get_output_operation () const |
get the output operation of this ExecutionGroup More... | |
MemoryBuffer * | construct_consolidated_memory_buffer (MemoryProxy &memory_proxy, rcti &rect) |
compose multiple chunks into a single chunk More... | |
void | init_execution () |
init_execution is called just before the execution of the whole graph will be done. More... | |
MemoryBuffer ** | get_input_buffers_opencl (int chunk_number) |
get all inputbuffers needed to calculate an chunk More... | |
MemoryBuffer * | allocate_output_buffer (rcti &rect) |
allocate the outputbuffer of a chunk More... | |
void | finalize_chunk_execution (int chunk_number, MemoryBuffer **memory_buffers) |
after a chunk is executed the needed resources can be freed or unlocked. More... | |
void | deinit_execution () |
deinit_execution is called just after execution the whole graph. More... | |
void | execute (ExecutionSystem *graph) |
schedule an ExecutionGroup More... | |
void | determine_chunk_rect (rcti *r_rect, unsigned int chunk_number) const |
Determine the rect (minx, maxx, miny, maxy) of a chunk. More... | |
void | set_chunksize (int chunksize) |
eCompositorPriority | get_render_priority () |
get the Render priority of this ExecutionGroup More... | |
void | set_viewer_border (float xmin, float xmax, float ymin, float ymax) |
set border for viewer operation More... | |
void | set_render_border (float xmin, float xmax, float ymin, float ymax) |
Friends | |
class | DebugInfo |
Class ExecutionGroup is a group of Operations that are executed as one. This grouping is used to combine Operations that can be executed as one whole when multi-processing.
Definition at line 68 of file COM_ExecutionGroup.h.
blender::compositor::ExecutionGroup::ExecutionGroup | ( | int | id | ) |
Definition at line 41 of file COM_ExecutionGroup.cc.
References BLI_rcti_init(), and id.
bool blender::compositor::ExecutionGroup::add_operation | ( | NodeOperation * | operation | ) |
add an operation to this ExecutionGroup
system | |
operation |
Definition at line 99 of file COM_ExecutionGroup.cc.
References blender::compositor::ExecutionGroupFlags::complex, blender::compositor::NodeOperationFlags::complex, blender::compositor::NodeOperation::get_flags(), blender::compositor::ExecutionGroupFlags::initialized, blender::compositor::NodeOperationFlags::is_read_buffer_operation, blender::compositor::NodeOperationFlags::is_write_buffer_operation, blender::compositor::ExecutionGroupFlags::open_cl, blender::compositor::NodeOperationFlags::open_cl, blender::compositor::ExecutionGroupFlags::single_threaded, and blender::compositor::NodeOperationFlags::single_threaded.
Referenced by blender::compositor::add_group_operations_recursive().
MemoryBuffer * blender::compositor::ExecutionGroup::allocate_output_buffer | ( | rcti & | rect | ) |
allocate the outputbuffer of a chunk
chunk_number | the number of the chunk in the ExecutionGroup |
rect | the rect of that chunk |
Definition at line 456 of file COM_ExecutionGroup.cc.
References buffer, blender::compositor::NodeOperation::get_flags(), blender::compositor::WriteBufferOperation::get_memory_proxy(), get_output_operation(), blender::compositor::NodeOperationFlags::is_write_buffer_operation, and blender::compositor::Temporary.
Referenced by blender::compositor::OpenCLDevice::execute().
MemoryBuffer * blender::compositor::ExecutionGroup::construct_consolidated_memory_buffer | ( | MemoryProxy & | memory_proxy, |
rcti & | rect | ||
) |
compose multiple chunks into a single chunk
Definition at line 384 of file COM_ExecutionGroup.cc.
References blender::compositor::MemoryProxy::get_buffer(), result, and blender::compositor::Temporary.
Referenced by get_input_buffers_opencl().
void blender::compositor::ExecutionGroup::deinit_execution | ( | ) |
deinit_execution is called just after execution the whole graph.
Definition at line 160 of file COM_ExecutionGroup.cc.
void blender::compositor::ExecutionGroup::determine_chunk_rect | ( | rcti * | r_rect, |
unsigned int | chunk_number | ||
) | const |
Determine the rect (minx, maxx, miny, maxy) of a chunk.
Definition at line 449 of file COM_ExecutionGroup.cc.
void blender::compositor::ExecutionGroup::determine_resolution | ( | unsigned int | resolution[2] | ) |
determine the resolution of this ExecutionGroup
resolution |
Definition at line 170 of file COM_ExecutionGroup.cc.
References BLI_rcti_init(), blender::compositor::NodeOperation::get_height(), get_output_operation(), blender::compositor::NodeOperation::get_width(), and set_resolution().
void blender::compositor::ExecutionGroup::execute | ( | ExecutionSystem * | graph | ) |
schedule an ExecutionGroup
first the order of the chunks will be determined. This is determined by finding the ViewerOperation and get the relevant information from it.
After determining the order of the chunks the chunks will be scheduled
graph | This method is called for the top execution groups. containing the compositor node or the preview node or the viewer node). |
Definition at line 290 of file COM_ExecutionGroup.cc.
References BLI_system_thread_count(), blender::compositor::context, blender::compositor::Executed, blender::compositor::DebugInfo::execution_group_finished(), blender::compositor::DebugInfo::execution_group_started(), blender::compositor::WorkScheduler::finish(), graph, blender::compositor::DebugInfo::graphviz(), blender::compositor::NotScheduled, PIL_check_seconds_timer(), blender::compositor::Scheduled, bNodeTree::tbh, bNodeTree::test_break, bNodeTree::udh, and bNodeTree::update_draw.
void blender::compositor::ExecutionGroup::finalize_chunk_execution | ( | int | chunk_number, |
MemoryBuffer ** | memory_buffers | ||
) |
after a chunk is executed the needed resources can be freed or unlocked.
chunknumber | |
memorybuffers |
Definition at line 393 of file COM_ExecutionGroup.cc.
References atomic_add_and_fetch_u(), BLI_snprintf(), buffer, blender::compositor::Executed, MEM_freeN, bNodeTree::prh, bNodeTree::progress, blender::compositor::Scheduled, bNodeTree::sdh, blender::compositor::WorkPackage::state, bNodeTree::stats_draw, and TIP_.
Referenced by blender::compositor::CPUDevice::execute(), and blender::compositor::OpenCLDevice::execute().
|
inline |
Definition at line 231 of file COM_ExecutionGroup.h.
Referenced by blender::compositor::opencl_schedule(), and blender::compositor::operator<<().
|
inline |
get the height of this execution group
Definition at line 283 of file COM_ExecutionGroup.h.
|
inline |
Definition at line 226 of file COM_ExecutionGroup.h.
Referenced by blender::compositor::operator<<().
MemoryBuffer ** blender::compositor::ExecutionGroup::get_input_buffers_opencl | ( | int | chunk_number | ) |
get all inputbuffers needed to calculate an chunk
chunk_number | the chunk to be calculated |
Definition at line 367 of file COM_ExecutionGroup.cc.
References construct_consolidated_memory_buffer(), blender::compositor::MemoryProxy::get_executor(), MEM_callocN, output, and blender::compositor::WorkPackage::rect.
Referenced by blender::compositor::OpenCLDevice::execute().
NodeOperation * blender::compositor::ExecutionGroup::get_output_operation | ( | ) | const |
get the output operation of this ExecutionGroup
Definition at line 118 of file COM_ExecutionGroup.cc.
Referenced by allocate_output_buffer(), determine_resolution(), blender::compositor::CPUDevice::execute(), blender::compositor::OpenCLDevice::execute(), get_render_priority(), blender::compositor::operator<<(), set_render_border(), and set_viewer_border().
eCompositorPriority blender::compositor::ExecutionGroup::get_render_priority | ( | ) |
get the Render priority of this ExecutionGroup
Definition at line 65 of file COM_ExecutionGroup.cc.
References get_output_operation(), and blender::compositor::NodeOperation::get_render_priority().
|
inline |
get the width of this execution group
Definition at line 275 of file COM_ExecutionGroup.h.
void blender::compositor::ExecutionGroup::init_execution | ( | ) |
init_execution is called just before the execution of the whole graph will be done.
Definition at line 153 of file COM_ExecutionGroup.cc.
|
inline |
Definition at line 362 of file COM_ExecutionGroup.h.
set whether this ExecutionGroup is an output
is_output |
Definition at line 251 of file COM_ExecutionGroup.h.
References blender::compositor::ExecutionGroupFlags::is_output.
Referenced by blender::compositor::NodeOperationBuilder::group_operations().
|
inline |
set the resolution of this executiongroup
resolution |
Definition at line 266 of file COM_ExecutionGroup.h.
Referenced by blender::compositor::ReadBufferOperation::determine_canvas(), and determine_resolution().
void blender::compositor::ExecutionGroup::set_viewer_border | ( | float | xmin, |
float | xmax, | ||
float | ymin, | ||
float | ymax | ||
) |
set border for viewer operation
Definition at line 565 of file COM_ExecutionGroup.cc.
References BLI_rcti_init(), blender::compositor::NodeOperation::get_flags(), get_output_operation(), and blender::compositor::NodeOperationFlags::use_viewer_border.
|
friend |
Definition at line 382 of file COM_ExecutionGroup.h.