Blender  V2.93
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 addOperation (NodeOperation *operation)
 add an operation to this ExecutionGroup More...
 
void setOutputExecutionGroup (bool is_output)
 set whether this ExecutionGroup is an output More...
 
void determineResolution (unsigned int resolution[2])
 determine the resolution of this ExecutionGroup More...
 
void setResolution (unsigned int resolution[2])
 set the resolution of this executiongroup More...
 
unsigned int getWidth () const
 get the width of this execution group More...
 
unsigned int getHeight () const
 get the height of this execution group More...
 
NodeOperationgetOutputOperation () const
 get the output operation of this ExecutionGroup More...
 
MemoryBufferconstructConsolidatedMemoryBuffer (MemoryProxy &memoryProxy, rcti &rect)
 compose multiple chunks into a single chunk More...
 
void initExecution ()
 initExecution is called just before the execution of the whole graph will be done. More...
 
MemoryBuffer ** getInputBuffersCPU ()
 get all inputbuffers needed to calculate an chunk More...
 
MemoryBuffer ** getInputBuffersOpenCL (int chunkNumber)
 get all inputbuffers needed to calculate an chunk More...
 
MemoryBufferallocateOutputBuffer (rcti &rect)
 allocate the outputbuffer of a chunk More...
 
void finalizeChunkExecution (int chunkNumber, MemoryBuffer **memoryBuffers)
 after a chunk is executed the needed resources can be freed or unlocked. More...
 
void deinitExecution ()
 deinitExecution is called just after execution the whole graph. More...
 
void execute (ExecutionSystem *graph)
 schedule an ExecutionGroup More...
 
void determineChunkRect (rcti *r_rect, const unsigned int chunkNumber) const
 Determine the rect (minx, maxx, miny, maxy) of a chunk. More...
 
void setChunksize (int chunksize)
 
eCompositorPriority getRenderPriority ()
 get the Render priority of this ExecutionGroup More...
 
void setViewerBorder (float xmin, float xmax, float ymin, float ymax)
 set border for viewer operation More...
 
void setRenderBorder (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 84 of file COM_ExecutionGroup.h.

Constructor & Destructor Documentation

◆ ExecutionGroup()

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

Definition at line 71 of file COM_ExecutionGroup.cc.

References BLI_rcti_init(), and id.

Member Function Documentation

◆ addOperation()

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

◆ allocateOutputBuffer()

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

allocate the outputbuffer of a chunk

Parameters
chunkNumberthe number of the chunk in the ExecutionGroup
rectthe rect of that chunk
See also
determineChunkRect

Definition at line 494 of file COM_ExecutionGroup.cc.

References buffer, blender::compositor::NodeOperation::get_flags(), blender::compositor::WriteBufferOperation::getMemoryProxy(), getOutputOperation(), blender::compositor::NodeOperationFlags::is_write_buffer_operation, and blender::compositor::Temporary.

Referenced by blender::compositor::OpenCLDevice::execute().

◆ constructConsolidatedMemoryBuffer()

MemoryBuffer * blender::compositor::ExecutionGroup::constructConsolidatedMemoryBuffer ( MemoryProxy memoryProxy,
rcti rect 
)

compose multiple chunks into a single chunk

Returns
Memorybuffer *consolidated chunk

Definition at line 418 of file COM_ExecutionGroup.cc.

References blender::compositor::MemoryProxy::getBuffer(), result, and blender::compositor::Temporary.

Referenced by getInputBuffersOpenCL().

◆ deinitExecution()

void blender::compositor::ExecutionGroup::deinitExecution ( )

deinitExecution is called just after execution the whole graph.

Note
It will release all needed resources

Definition at line 189 of file COM_ExecutionGroup.cc.

◆ determineChunkRect()

void blender::compositor::ExecutionGroup::determineChunkRect ( rcti r_rect,
const unsigned int  chunkNumber 
) const

Determine the rect (minx, maxx, miny, maxy) of a chunk.

Definition at line 487 of file COM_ExecutionGroup.cc.

◆ determineResolution()

void blender::compositor::ExecutionGroup::determineResolution ( 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 323 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.

◆ finalizeChunkExecution()

void blender::compositor::ExecutionGroup::finalizeChunkExecution ( int  chunkNumber,
MemoryBuffer **  memoryBuffers 
)

◆ get_flags()

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

◆ get_id()

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

Definition at line 243 of file COM_ExecutionGroup.h.

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

◆ getHeight()

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

get the height of this execution group

Definition at line 300 of file COM_ExecutionGroup.h.

References m_height.

◆ getInputBuffersCPU()

MemoryBuffer** blender::compositor::ExecutionGroup::getInputBuffersCPU ( )

get all inputbuffers needed to calculate an chunk

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

◆ getInputBuffersOpenCL()

MemoryBuffer ** blender::compositor::ExecutionGroup::getInputBuffersOpenCL ( int  chunkNumber)

get all inputbuffers needed to calculate an chunk

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

Definition at line 401 of file COM_ExecutionGroup.cc.

References constructConsolidatedMemoryBuffer(), blender::compositor::MemoryProxy::getExecutor(), MEM_callocN, output, and blender::compositor::WorkPackage::rect.

Referenced by blender::compositor::OpenCLDevice::execute().

◆ getOutputOperation()

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

◆ getRenderPriority()

eCompositorPriority blender::compositor::ExecutionGroup::getRenderPriority ( )

◆ getWidth()

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

get the width of this execution group

Definition at line 292 of file COM_ExecutionGroup.h.

References m_width.

◆ initExecution()

void blender::compositor::ExecutionGroup::initExecution ( )

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

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

Definition at line 182 of file COM_ExecutionGroup.cc.

◆ setChunksize()

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

Definition at line 383 of file COM_ExecutionGroup.h.

◆ setOutputExecutionGroup()

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

set whether this ExecutionGroup is an output

Parameters
isOutput

Definition at line 268 of file COM_ExecutionGroup.h.

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

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

◆ setRenderBorder()

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

◆ setResolution()

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

set the resolution of this executiongroup

Parameters
resolution

Definition at line 283 of file COM_ExecutionGroup.h.

Referenced by determineResolution(), and blender::compositor::ReadBufferOperation::determineResolution().

◆ setViewerBorder()

void blender::compositor::ExecutionGroup::setViewerBorder ( 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 601 of file COM_ExecutionGroup.cc.

References BLI_rcti_init(), blender::compositor::NodeOperation::get_flags(), getOutputOperation(), and blender::compositor::NodeOperationFlags::use_viewer_border.

Friends And Related Function Documentation

◆ DebugInfo

friend class DebugInfo
friend

Definition at line 403 of file COM_ExecutionGroup.h.


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