Blender  V3.3
Public Member Functions | Friends | List of all members
blender::compositor::ExecutionGroup Class Reference

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...
 
NodeOperationget_output_operation () const
 get the output operation of this ExecutionGroup More...
 
MemoryBufferconstruct_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...
 
MemoryBufferallocate_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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ExecutionGroup()

blender::compositor::ExecutionGroup::ExecutionGroup ( int  id)

Definition at line 41 of file COM_ExecutionGroup.cc.

References BLI_rcti_init(), and id.

Member Function Documentation

◆ add_operation()

bool blender::compositor::ExecutionGroup::add_operation ( NodeOperation operation)

◆ allocate_output_buffer()

MemoryBuffer * blender::compositor::ExecutionGroup::allocate_output_buffer ( rcti rect)

allocate the outputbuffer of a chunk

Parameters
chunk_numberthe number of the chunk in the ExecutionGroup
rectthe rect of that chunk
See also
determine_chunk_rect

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().

◆ construct_consolidated_memory_buffer()

MemoryBuffer * blender::compositor::ExecutionGroup::construct_consolidated_memory_buffer ( MemoryProxy memory_proxy,
rcti rect 
)

compose multiple chunks into a single chunk

Returns
Memorybuffer *consolidated 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().

◆ deinit_execution()

void blender::compositor::ExecutionGroup::deinit_execution ( )

deinit_execution is called just after execution the whole graph.

Note
It will release all needed resources

Definition at line 160 of file COM_ExecutionGroup.cc.

◆ determine_chunk_rect()

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.

◆ determine_resolution()

void blender::compositor::ExecutionGroup::determine_resolution ( unsigned int  resolution[2])

◆ execute()

void blender::compositor::ExecutionGroup::execute ( ExecutionSystem graph)

schedule an ExecutionGroup

Note
this method will return when all chunks have been calculated, or the execution has breaked (by user)

first the order of the chunks will be determined. This is determined by finding the ViewerOperation and get the relevant information from it.

  • ChunkOrdering
  • CenterX
  • CenterY

After determining the order of the chunks the chunks will be scheduled

See also
ViewerOperation
Parameters
graphThis method is called for the top execution groups. containing the compositor node or the preview node or the viewer node).
Note
Break out... no pixels to calculate.
Early break out for blur and preview nodes.
Early break out.

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.

◆ finalize_chunk_execution()

void blender::compositor::ExecutionGroup::finalize_chunk_execution ( int  chunk_number,
MemoryBuffer **  memory_buffers 
)

◆ get_flags()

const ExecutionGroupFlags blender::compositor::ExecutionGroup::get_flags ( ) const
inline

◆ get_height()

unsigned int blender::compositor::ExecutionGroup::get_height ( ) const
inline

get the height of this execution group

Definition at line 283 of file COM_ExecutionGroup.h.

◆ get_id()

int blender::compositor::ExecutionGroup::get_id ( ) const
inline

Definition at line 226 of file COM_ExecutionGroup.h.

Referenced by blender::compositor::operator<<().

◆ get_input_buffers_opencl()

MemoryBuffer ** blender::compositor::ExecutionGroup::get_input_buffers_opencl ( int  chunk_number)

get all inputbuffers needed to calculate an chunk

Note
all inputbuffers must be executed
Parameters
chunk_numberthe chunk to be calculated
Returns
(MemoryBuffer **) the inputbuffers

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().

◆ get_output_operation()

NodeOperation * blender::compositor::ExecutionGroup::get_output_operation ( ) const

◆ get_render_priority()

eCompositorPriority blender::compositor::ExecutionGroup::get_render_priority ( )

◆ get_width()

unsigned int blender::compositor::ExecutionGroup::get_width ( ) const
inline

get the width of this execution group

Definition at line 275 of file COM_ExecutionGroup.h.

◆ init_execution()

void blender::compositor::ExecutionGroup::init_execution ( )

init_execution is called just before the execution of the whole graph will be done.

Note
The implementation will calculate the chunk_size of this execution group.

Definition at line 153 of file COM_ExecutionGroup.cc.

◆ set_chunksize()

void blender::compositor::ExecutionGroup::set_chunksize ( int  chunksize)
inline

Definition at line 362 of file COM_ExecutionGroup.h.

◆ set_output_execution_group()

void blender::compositor::ExecutionGroup::set_output_execution_group ( bool  is_output)
inline

set whether this ExecutionGroup is an output

Parameters
is_output

Definition at line 251 of file COM_ExecutionGroup.h.

References blender::compositor::ExecutionGroupFlags::is_output.

Referenced by blender::compositor::NodeOperationBuilder::group_operations().

◆ set_render_border()

void blender::compositor::ExecutionGroup::set_render_border ( float  xmin,
float  xmax,
float  ymin,
float  ymax 
)

◆ set_resolution()

void blender::compositor::ExecutionGroup::set_resolution ( unsigned int  resolution[2])
inline

set the resolution of this executiongroup

Parameters
resolution

Definition at line 266 of file COM_ExecutionGroup.h.

Referenced by blender::compositor::ReadBufferOperation::determine_canvas(), and determine_resolution().

◆ set_viewer_border()

void blender::compositor::ExecutionGroup::set_viewer_border ( float  xmin,
float  xmax,
float  ymin,
float  ymax 
)

set border for viewer operation

Note
all the coordinates are assumed to be in normalized space

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.

Friends And Related Function Documentation

◆ DebugInfo

friend class DebugInfo
friend

Definition at line 382 of file COM_ExecutionGroup.h.


The documentation for this class was generated from the following files: