Cleanup: Use Bitflags For Booleans.
This commit is contained in:
@@ -50,8 +50,6 @@ namespace blender::compositor {
|
||||
|
||||
ExecutionGroup::ExecutionGroup()
|
||||
{
|
||||
this->m_is_output = false;
|
||||
this->m_complex = false;
|
||||
this->m_bTree = nullptr;
|
||||
this->m_height = 0;
|
||||
this->m_width = 0;
|
||||
@@ -60,8 +58,6 @@ ExecutionGroup::ExecutionGroup()
|
||||
this->m_y_chunks_len = 0;
|
||||
this->m_chunks_len = 0;
|
||||
this->m_initialized = false;
|
||||
this->m_openCL = false;
|
||||
this->m_singleThreaded = false;
|
||||
this->m_chunks_finished = 0;
|
||||
BLI_rcti_init(&this->m_viewerBorder, 0, 0, 0, 0);
|
||||
this->m_executionStartTime = 0;
|
||||
@@ -89,12 +85,12 @@ bool ExecutionGroup::can_contain(NodeOperation &operation)
|
||||
}
|
||||
|
||||
/* complex groups don't allow further ops (except read buffer and values, see above) */
|
||||
if (m_complex) {
|
||||
if (m_flags.complex) {
|
||||
return false;
|
||||
}
|
||||
/* complex ops can't be added to other groups (except their own, which they initialize, see
|
||||
* above) */
|
||||
if (operation.isComplex()) {
|
||||
if (operation.get_flags().complex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -108,9 +104,9 @@ bool ExecutionGroup::addOperation(NodeOperation *operation)
|
||||
}
|
||||
|
||||
if (!operation->isReadBufferOperation() && !operation->isWriteBufferOperation()) {
|
||||
m_complex = operation->isComplex();
|
||||
m_openCL = operation->isOpenCL();
|
||||
m_singleThreaded = operation->isSingleThreaded();
|
||||
m_flags.complex = operation->get_flags().complex;
|
||||
m_flags.open_cl = operation->get_flags().open_cl;
|
||||
m_flags.single_threaded = operation->isSingleThreaded();
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
@@ -168,7 +164,7 @@ void ExecutionGroup::determineResolution(unsigned int resolution[2])
|
||||
|
||||
void ExecutionGroup::determineNumberOfChunks()
|
||||
{
|
||||
if (this->m_singleThreaded) {
|
||||
if (this->m_flags.single_threaded) {
|
||||
this->m_x_chunks_len = 1;
|
||||
this->m_y_chunks_len = 1;
|
||||
this->m_chunks_len = 1;
|
||||
@@ -429,7 +425,7 @@ inline void ExecutionGroup::determineChunkRect(rcti *rect,
|
||||
const int border_width = BLI_rcti_size_x(&this->m_viewerBorder);
|
||||
const int border_height = BLI_rcti_size_y(&this->m_viewerBorder);
|
||||
|
||||
if (this->m_singleThreaded) {
|
||||
if (this->m_flags.single_threaded) {
|
||||
BLI_rcti_init(
|
||||
rect, this->m_viewerBorder.xmin, border_width, this->m_viewerBorder.ymin, border_height);
|
||||
}
|
||||
@@ -468,7 +464,7 @@ MemoryBuffer *ExecutionGroup::allocateOutputBuffer(rcti &rect)
|
||||
|
||||
bool ExecutionGroup::scheduleAreaWhenPossible(ExecutionSystem *graph, rcti *area)
|
||||
{
|
||||
if (this->m_singleThreaded) {
|
||||
if (this->m_flags.single_threaded) {
|
||||
return scheduleChunkWhenPossible(graph, 0, 0);
|
||||
}
|
||||
// find all chunks inside the rect
|
||||
@@ -560,16 +556,10 @@ void ExecutionGroup::determineDependingAreaOfInterest(rcti *input,
|
||||
this->getOutputOperation()->determineDependingAreaOfInterest(input, readOperation, output);
|
||||
}
|
||||
|
||||
bool ExecutionGroup::isOpenCL()
|
||||
{
|
||||
return this->m_openCL;
|
||||
}
|
||||
|
||||
void ExecutionGroup::setViewerBorder(float xmin, float xmax, float ymin, float ymax)
|
||||
{
|
||||
NodeOperation *operation = this->getOutputOperation();
|
||||
|
||||
if (operation->isViewerOperation() || operation->isPreviewOperation()) {
|
||||
const NodeOperation &operation = *this->getOutputOperation();
|
||||
if (operation.get_flags().use_viewer_border) {
|
||||
BLI_rcti_init(&this->m_viewerBorder,
|
||||
xmin * this->m_width,
|
||||
xmax * this->m_width,
|
||||
@@ -580,33 +570,13 @@ void ExecutionGroup::setViewerBorder(float xmin, float xmax, float ymin, float y
|
||||
|
||||
void ExecutionGroup::setRenderBorder(float xmin, float xmax, float ymin, float ymax)
|
||||
{
|
||||
NodeOperation *operation = this->getOutputOperation();
|
||||
|
||||
if (operation->isOutputOperation(true)) {
|
||||
/* Basically, setting border need to happen for only operations
|
||||
* which operates in render resolution buffers (like compositor
|
||||
* output nodes).
|
||||
*
|
||||
* In this cases adding border will lead to mapping coordinates
|
||||
* from output buffer space to input buffer spaces when executing
|
||||
* operation.
|
||||
*
|
||||
* But nodes like viewer and file output just shall display or
|
||||
* safe the same exact buffer which goes to their input, no need
|
||||
* in any kind of coordinates mapping.
|
||||
*/
|
||||
|
||||
bool operationNeedsBorder = !(operation->isViewerOperation() ||
|
||||
operation->isPreviewOperation() ||
|
||||
operation->isFileOutputOperation());
|
||||
|
||||
if (operationNeedsBorder) {
|
||||
BLI_rcti_init(&this->m_viewerBorder,
|
||||
xmin * this->m_width,
|
||||
xmax * this->m_width,
|
||||
ymin * this->m_height,
|
||||
ymax * this->m_height);
|
||||
}
|
||||
const NodeOperation &operation = *this->getOutputOperation();
|
||||
if (operation.isOutputOperation(true) && operation.get_flags().use_render_border) {
|
||||
BLI_rcti_init(&this->m_viewerBorder,
|
||||
xmin * this->m_width,
|
||||
xmax * this->m_width,
|
||||
ymin * this->m_height,
|
||||
ymax * this->m_height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,35 @@ enum class eChunkExecutionState {
|
||||
EXECUTED = 2,
|
||||
};
|
||||
|
||||
struct ExecutionGroupFlags {
|
||||
/**
|
||||
* Is this ExecutionGroup an output ExecutionGroup
|
||||
* An OutputExecution group are groups containing a
|
||||
* ViewerOperation, CompositeOperation, PreviewOperation.
|
||||
*/
|
||||
bool is_output : 1;
|
||||
bool complex : 1;
|
||||
|
||||
/**
|
||||
* Can this ExecutionGroup be scheduled on an OpenCLDevice.
|
||||
*/
|
||||
bool open_cl : 1;
|
||||
|
||||
/**
|
||||
* Schedule this execution group as a single chunk. This
|
||||
* chunk will be executed by a single thread.
|
||||
*/
|
||||
bool single_threaded : 1;
|
||||
|
||||
ExecutionGroupFlags()
|
||||
{
|
||||
is_output = false;
|
||||
complex = false;
|
||||
open_cl = false;
|
||||
single_threaded = false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief 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
|
||||
@@ -75,12 +104,7 @@ class ExecutionGroup {
|
||||
*/
|
||||
blender::Vector<NodeOperation *> m_operations;
|
||||
|
||||
/**
|
||||
* \brief is this ExecutionGroup an input ExecutionGroup
|
||||
* an input execution group is a group that is at the end of the calculation
|
||||
* (the output is important for the user).
|
||||
*/
|
||||
bool m_is_output;
|
||||
ExecutionGroupFlags m_flags;
|
||||
|
||||
/**
|
||||
* \brief Width of the output
|
||||
@@ -113,21 +137,6 @@ class ExecutionGroup {
|
||||
*/
|
||||
unsigned int m_chunks_len;
|
||||
|
||||
/**
|
||||
* \brief contains this ExecutionGroup a complex NodeOperation.
|
||||
*/
|
||||
bool m_complex;
|
||||
|
||||
/**
|
||||
* \brief can this ExecutionGroup be scheduled on an OpenCLDevice
|
||||
*/
|
||||
bool m_openCL;
|
||||
|
||||
/**
|
||||
* \brief Is this Execution group SingleThreaded
|
||||
*/
|
||||
bool m_singleThreaded;
|
||||
|
||||
/**
|
||||
* \brief what is the maximum number field of all ReadBufferOperation in this ExecutionGroup.
|
||||
* \note this is used to construct the MemoryBuffers that will be passed during execution.
|
||||
@@ -261,6 +270,11 @@ class ExecutionGroup {
|
||||
// constructors
|
||||
ExecutionGroup();
|
||||
|
||||
const ExecutionGroupFlags get_flags() const
|
||||
{
|
||||
return m_flags;
|
||||
}
|
||||
|
||||
// methods
|
||||
/**
|
||||
* \brief add an operation to this ExecutionGroup
|
||||
@@ -272,24 +286,13 @@ class ExecutionGroup {
|
||||
*/
|
||||
bool addOperation(NodeOperation *operation);
|
||||
|
||||
/**
|
||||
* \brief is this ExecutionGroup an output ExecutionGroup
|
||||
* \note An OutputExecution group are groups containing a
|
||||
* \note ViewerOperation, CompositeOperation, PreviewOperation.
|
||||
* \see NodeOperation.isOutputOperation
|
||||
*/
|
||||
bool isOutputExecutionGroup() const
|
||||
{
|
||||
return this->m_is_output;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief set whether this ExecutionGroup is an output
|
||||
* \param isOutput:
|
||||
*/
|
||||
void setOutputExecutionGroup(bool is_output)
|
||||
{
|
||||
this->m_is_output = is_output;
|
||||
this->m_flags.is_output = is_output;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -324,14 +327,6 @@ class ExecutionGroup {
|
||||
return m_height;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief does this ExecutionGroup contains a complex NodeOperation
|
||||
*/
|
||||
bool isComplex() const
|
||||
{
|
||||
return m_complex;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief get the output operation of this ExecutionGroup
|
||||
* \return NodeOperation *output operation
|
||||
@@ -412,12 +407,6 @@ class ExecutionGroup {
|
||||
*/
|
||||
void determineChunkRect(rcti *rect, const unsigned int chunkNumber) const;
|
||||
|
||||
/**
|
||||
* \brief can this ExecutionGroup be scheduled on an OpenCLDevice
|
||||
* \see WorkScheduler.schedule
|
||||
*/
|
||||
bool isOpenCL();
|
||||
|
||||
void setChunksize(int chunksize)
|
||||
{
|
||||
this->m_chunkSize = chunksize;
|
||||
|
||||
@@ -215,7 +215,7 @@ void ExecutionSystem::execute()
|
||||
void ExecutionSystem::execute_groups(CompositorPriority priority)
|
||||
{
|
||||
for (ExecutionGroup *execution_group : m_groups) {
|
||||
if (execution_group->isOutputExecutionGroup() &&
|
||||
if (execution_group->get_flags().is_output &&
|
||||
execution_group->getRenderPriority() == priority) {
|
||||
execution_group->execute(this);
|
||||
}
|
||||
|
||||
@@ -33,11 +33,8 @@ namespace blender::compositor {
|
||||
NodeOperation::NodeOperation()
|
||||
{
|
||||
this->m_resolutionInputSocketIndex = 0;
|
||||
this->m_complex = false;
|
||||
this->m_width = 0;
|
||||
this->m_height = 0;
|
||||
this->m_isResolutionSet = false;
|
||||
this->m_openCL = false;
|
||||
this->m_btree = nullptr;
|
||||
}
|
||||
|
||||
@@ -202,7 +199,7 @@ void NodeOperationOutput::determineResolution(unsigned int resolution[2],
|
||||
unsigned int preferredResolution[2])
|
||||
{
|
||||
NodeOperation &operation = getOperation();
|
||||
if (operation.isResolutionSet()) {
|
||||
if (operation.get_flags().is_resolution_set) {
|
||||
resolution[0] = operation.getWidth();
|
||||
resolution[1] = operation.getHeight();
|
||||
}
|
||||
|
||||
@@ -165,6 +165,55 @@ class NodeOperationOutput {
|
||||
#endif
|
||||
};
|
||||
|
||||
struct NodeOperationFlags {
|
||||
/**
|
||||
* Is this an complex operation.
|
||||
*
|
||||
* The input and output buffers of Complex operations are stored in buffers. It allows
|
||||
* sequential and read/write.
|
||||
*
|
||||
* Complex operations are typically doing many reads to calculate the output of a single pixel.
|
||||
* Mostly Filter types (Blurs, Convolution, Defocus etc) need this to be set to true.
|
||||
*/
|
||||
bool complex : 1;
|
||||
|
||||
/**
|
||||
* Does this operation support OpenCL.
|
||||
*/
|
||||
bool open_cl : 1;
|
||||
|
||||
/**
|
||||
* Does the operation needs a viewer border.
|
||||
* Basically, setting border need to happen for only operations
|
||||
* which operates in render resolution buffers (like compositor
|
||||
* output nodes).
|
||||
*
|
||||
* In this cases adding border will lead to mapping coordinates
|
||||
* from output buffer space to input buffer spaces when executing
|
||||
* operation.
|
||||
*
|
||||
* But nodes like viewer and file output just shall display or
|
||||
* safe the same exact buffer which goes to their input, no need
|
||||
* in any kind of coordinates mapping.
|
||||
*/
|
||||
bool use_render_border : 1;
|
||||
bool use_viewer_border : 1;
|
||||
|
||||
/**
|
||||
* Is the resolution of the operation set.
|
||||
*/
|
||||
bool is_resolution_set : 1;
|
||||
|
||||
NodeOperationFlags()
|
||||
{
|
||||
complex = false;
|
||||
open_cl = false;
|
||||
use_render_border = false;
|
||||
use_viewer_border = false;
|
||||
is_resolution_set = false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief NodeOperation contains calculation logic
|
||||
*
|
||||
@@ -181,20 +230,6 @@ class NodeOperation {
|
||||
*/
|
||||
unsigned int m_resolutionInputSocketIndex;
|
||||
|
||||
/**
|
||||
* \brief is this operation a complex one.
|
||||
*
|
||||
* Complex operations are typically doing many reads to calculate the output of a single pixel.
|
||||
* Mostly Filter types (Blurs, Convolution, Defocus etc) need this to be set to true.
|
||||
*/
|
||||
bool m_complex;
|
||||
|
||||
/**
|
||||
* \brief can this operation be scheduled on an OpenCL device.
|
||||
* \note Only applicable if complex is True
|
||||
*/
|
||||
bool m_openCL;
|
||||
|
||||
/**
|
||||
* \brief mutex reference for very special node initializations
|
||||
* \note only use when you really know what you are doing.
|
||||
@@ -211,11 +246,6 @@ class NodeOperation {
|
||||
*/
|
||||
const bNodeTree *m_btree;
|
||||
|
||||
/**
|
||||
* \brief set to truth when resolution for this operation is set
|
||||
*/
|
||||
bool m_isResolutionSet;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Width of the output of this operation.
|
||||
@@ -227,11 +257,21 @@ class NodeOperation {
|
||||
*/
|
||||
unsigned int m_height;
|
||||
|
||||
/**
|
||||
* Flags how to evaluate this operation.
|
||||
*/
|
||||
NodeOperationFlags flags;
|
||||
|
||||
public:
|
||||
virtual ~NodeOperation()
|
||||
{
|
||||
}
|
||||
|
||||
const NodeOperationFlags get_flags() const
|
||||
{
|
||||
return flags;
|
||||
}
|
||||
|
||||
unsigned int getNumberOfInputSockets() const
|
||||
{
|
||||
return m_inputs.size();
|
||||
@@ -347,35 +387,19 @@ class NodeOperation {
|
||||
}
|
||||
virtual void deinitExecution();
|
||||
|
||||
bool isResolutionSet()
|
||||
{
|
||||
return this->m_isResolutionSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief set the resolution
|
||||
* \param resolution: the resolution to set
|
||||
*/
|
||||
void setResolution(unsigned int resolution[2])
|
||||
{
|
||||
if (!isResolutionSet()) {
|
||||
if (!this->flags.is_resolution_set) {
|
||||
this->m_width = resolution[0];
|
||||
this->m_height = resolution[1];
|
||||
this->m_isResolutionSet = true;
|
||||
this->flags.is_resolution_set = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief is this operation complex
|
||||
*
|
||||
* Complex operations are typically doing many reads to calculate the output of a single pixel.
|
||||
* Mostly Filter types (Blurs, Convolution, Defocus etc) need this to be set to true.
|
||||
*/
|
||||
bool isComplex() const
|
||||
{
|
||||
return this->m_complex;
|
||||
}
|
||||
|
||||
virtual bool isSetOperation() const
|
||||
{
|
||||
return false;
|
||||
@@ -433,16 +457,6 @@ class NodeOperation {
|
||||
return CompositorPriority::Low;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief can this NodeOperation be scheduled on an OpenCLDevice
|
||||
* \see WorkScheduler.schedule
|
||||
* \see ExecutionGroup.addOperation
|
||||
*/
|
||||
bool isOpenCL() const
|
||||
{
|
||||
return this->m_openCL;
|
||||
}
|
||||
|
||||
virtual bool isViewerOperation() const
|
||||
{
|
||||
return false;
|
||||
@@ -451,10 +465,6 @@ class NodeOperation {
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool isFileOutputOperation() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool isProxyOperation() const
|
||||
{
|
||||
return false;
|
||||
@@ -534,12 +544,12 @@ class NodeOperation {
|
||||
void setWidth(unsigned int width)
|
||||
{
|
||||
this->m_width = width;
|
||||
this->m_isResolutionSet = true;
|
||||
this->flags.is_resolution_set = true;
|
||||
}
|
||||
void setHeight(unsigned int height)
|
||||
{
|
||||
this->m_height = height;
|
||||
this->m_isResolutionSet = true;
|
||||
this->flags.is_resolution_set = true;
|
||||
}
|
||||
SocketReader *getInputSocketReader(unsigned int inputSocketindex);
|
||||
NodeOperation *getInputOperation(unsigned int inputSocketindex);
|
||||
@@ -557,15 +567,7 @@ class NodeOperation {
|
||||
*/
|
||||
void setComplex(bool complex)
|
||||
{
|
||||
this->m_complex = complex;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief set if this NodeOperation can be scheduled on a OpenCLDevice
|
||||
*/
|
||||
void setOpenCL(bool openCL)
|
||||
{
|
||||
this->m_openCL = openCL;
|
||||
this->flags.complex = complex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -536,7 +536,7 @@ void NodeOperationBuilder::add_complex_operation_buffers()
|
||||
*/
|
||||
blender::Vector<NodeOperation *> complex_ops;
|
||||
for (NodeOperation *operation : m_operations) {
|
||||
if (operation->isComplex()) {
|
||||
if (operation->get_flags().complex) {
|
||||
complex_ops.append(operation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace blender::compositor {
|
||||
SingleThreadedOperation::SingleThreadedOperation()
|
||||
{
|
||||
this->m_cachedInstance = nullptr;
|
||||
setComplex(true);
|
||||
flags.complex = true;
|
||||
}
|
||||
|
||||
void SingleThreadedOperation::initExecution()
|
||||
|
||||
@@ -144,7 +144,7 @@ static void opencl_start(CompositorContext &context)
|
||||
|
||||
static bool opencl_schedule(WorkPackage *package)
|
||||
{
|
||||
if (package->execution_group->isOpenCL() && g_work_scheduler.opencl.active) {
|
||||
if (package->execution_group->get_flags().open_cl && g_work_scheduler.opencl.active) {
|
||||
BLI_thread_queue_push(g_work_scheduler.opencl.queue, package);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ struct WorkScheduler {
|
||||
/**
|
||||
* \brief schedule a chunk of a group to be calculated.
|
||||
* An execution group schedules a chunk in the WorkScheduler
|
||||
* when ExecutionGroup.isOpenCL is set the work will be handled by a OpenCLDevice
|
||||
* when ExecutionGroup.get_flags().open_cl is set the work will be handled by a OpenCLDevice
|
||||
* otherwise the work is scheduled for an CPUDevice
|
||||
* \see ExecutionGroup.execute
|
||||
* \param group: the execution group
|
||||
|
||||
@@ -119,7 +119,7 @@ AntiAliasOperation::AntiAliasOperation()
|
||||
this->addInputSocket(DataType::Value);
|
||||
this->addOutputSocket(DataType::Value);
|
||||
this->m_valueReader = nullptr;
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
}
|
||||
|
||||
void AntiAliasOperation::initExecution()
|
||||
|
||||
@@ -28,7 +28,7 @@ BilateralBlurOperation::BilateralBlurOperation()
|
||||
this->addInputSocket(DataType::Color);
|
||||
this->addInputSocket(DataType::Color);
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
|
||||
this->m_inputColorProgram = nullptr;
|
||||
this->m_inputDeterminatorProgram = nullptr;
|
||||
|
||||
@@ -30,7 +30,7 @@ BlurBaseOperation::BlurBaseOperation(DataType data_type)
|
||||
this->addInputSocket(data_type);
|
||||
this->addInputSocket(DataType::Value);
|
||||
this->addOutputSocket(data_type);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
this->m_inputProgram = nullptr;
|
||||
memset(&m_data, 0, sizeof(NodeBlurData));
|
||||
this->m_size = 1.0f;
|
||||
|
||||
@@ -31,8 +31,9 @@ BokehBlurOperation::BokehBlurOperation()
|
||||
this->addInputSocket(DataType::Value);
|
||||
this->addInputSocket(DataType::Value);
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setComplex(true);
|
||||
this->setOpenCL(true);
|
||||
|
||||
flags.complex = true;
|
||||
flags.open_cl = true;
|
||||
|
||||
this->m_size = 1.0f;
|
||||
this->m_sizeavailable = false;
|
||||
|
||||
@@ -31,7 +31,7 @@ CalculateMeanOperation::CalculateMeanOperation()
|
||||
this->m_imageReader = nullptr;
|
||||
this->m_iscalculated = false;
|
||||
this->m_setting = 1;
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
}
|
||||
void CalculateMeanOperation::initExecution()
|
||||
{
|
||||
|
||||
@@ -52,6 +52,8 @@ CompositorOperation::CompositorOperation()
|
||||
this->m_scene = nullptr;
|
||||
this->m_sceneName[0] = '\0';
|
||||
this->m_viewName = nullptr;
|
||||
|
||||
flags.use_render_border = true;
|
||||
}
|
||||
|
||||
void CompositorOperation::initExecution()
|
||||
|
||||
@@ -31,7 +31,7 @@ ConvolutionFilterOperation::ConvolutionFilterOperation()
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setResolutionInputSocketIndex(0);
|
||||
this->m_inputOperation = nullptr;
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
}
|
||||
void ConvolutionFilterOperation::initExecution()
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ CryptomatteOperation::CryptomatteOperation(size_t num_inputs)
|
||||
}
|
||||
inputs.resize(num_inputs);
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
}
|
||||
|
||||
void CryptomatteOperation::initExecution()
|
||||
|
||||
@@ -31,7 +31,7 @@ DespeckleOperation::DespeckleOperation()
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setResolutionInputSocketIndex(0);
|
||||
this->m_inputOperation = nullptr;
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
}
|
||||
void DespeckleOperation::initExecution()
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ DilateErodeThresholdOperation::DilateErodeThresholdOperation()
|
||||
{
|
||||
this->addInputSocket(DataType::Value);
|
||||
this->addOutputSocket(DataType::Value);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
this->m_inputProgram = nullptr;
|
||||
this->m_inset = 0.0f;
|
||||
this->m__switch = 0.5f;
|
||||
@@ -165,10 +165,10 @@ DilateDistanceOperation::DilateDistanceOperation()
|
||||
{
|
||||
this->addInputSocket(DataType::Value);
|
||||
this->addOutputSocket(DataType::Value);
|
||||
this->setComplex(true);
|
||||
this->m_inputProgram = nullptr;
|
||||
this->m_distance = 0.0f;
|
||||
this->setOpenCL(true);
|
||||
flags.complex = true;
|
||||
flags.open_cl = true;
|
||||
}
|
||||
void DilateDistanceOperation::initExecution()
|
||||
{
|
||||
@@ -323,7 +323,7 @@ DilateStepOperation::DilateStepOperation()
|
||||
{
|
||||
this->addInputSocket(DataType::Value);
|
||||
this->addOutputSocket(DataType::Value);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
this->m_inputProgram = nullptr;
|
||||
}
|
||||
void DilateStepOperation::initExecution()
|
||||
|
||||
@@ -29,9 +29,8 @@ DirectionalBlurOperation::DirectionalBlurOperation()
|
||||
{
|
||||
this->addInputSocket(DataType::Color);
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setComplex(true);
|
||||
|
||||
this->setOpenCL(true);
|
||||
flags.complex = true;
|
||||
flags.open_cl = true;
|
||||
this->m_inputProgram = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ DisplaceOperation::DisplaceOperation()
|
||||
this->addInputSocket(DataType::Value);
|
||||
this->addInputSocket(DataType::Value);
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
|
||||
this->m_inputColorProgram = nullptr;
|
||||
this->m_inputVectorProgram = nullptr;
|
||||
|
||||
@@ -1317,7 +1317,7 @@ DoubleEdgeMaskOperation::DoubleEdgeMaskOperation()
|
||||
this->m_inputOuterMask = nullptr;
|
||||
this->m_adjacentOnly = false;
|
||||
this->m_keepInside = false;
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
}
|
||||
|
||||
bool DoubleEdgeMaskOperation::determineDependingAreaOfInterest(rcti * /*input*/,
|
||||
|
||||
@@ -266,7 +266,7 @@ FastGaussianBlurValueOperation::FastGaussianBlurValueOperation()
|
||||
this->m_inputprogram = nullptr;
|
||||
this->m_sigma = 1.0f;
|
||||
this->m_overlay = 0;
|
||||
setComplex(true);
|
||||
flags.complex = true;
|
||||
}
|
||||
|
||||
void FastGaussianBlurValueOperation::executePixel(float output[4], int x, int y, void *data)
|
||||
|
||||
@@ -64,7 +64,7 @@ class GaussianXBlurOperation : public BlurBaseOperation {
|
||||
|
||||
void checkOpenCL()
|
||||
{
|
||||
this->setOpenCL(m_data.sizex >= 128);
|
||||
flags.open_cl = (m_data.sizex >= 128);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ class GaussianYBlurOperation : public BlurBaseOperation {
|
||||
|
||||
void checkOpenCL()
|
||||
{
|
||||
this->setOpenCL(m_data.sizex >= 128);
|
||||
flags.open_cl = (m_data.sizex >= 128);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ IDMaskOperation::IDMaskOperation()
|
||||
{
|
||||
this->addInputSocket(DataType::Value);
|
||||
this->addOutputSocket(DataType::Value);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
}
|
||||
|
||||
void *IDMaskOperation::initializeTileData(rcti *rect)
|
||||
|
||||
@@ -33,7 +33,7 @@ InpaintSimpleOperation::InpaintSimpleOperation()
|
||||
{
|
||||
this->addInputSocket(DataType::Color);
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
this->m_inputImageProgram = nullptr;
|
||||
this->m_pixelorder = nullptr;
|
||||
this->m_manhattan_distance = nullptr;
|
||||
|
||||
@@ -33,7 +33,7 @@ KeyingBlurOperation::KeyingBlurOperation()
|
||||
this->m_size = 0;
|
||||
this->m_axis = BLUR_AXIS_X;
|
||||
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
}
|
||||
|
||||
void *KeyingBlurOperation::initializeTileData(rcti *rect)
|
||||
|
||||
@@ -38,7 +38,7 @@ KeyingClipOperation::KeyingClipOperation()
|
||||
|
||||
this->m_isEdgeMatte = false;
|
||||
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
}
|
||||
|
||||
void *KeyingClipOperation::initializeTileData(rcti *rect)
|
||||
|
||||
@@ -38,7 +38,7 @@ KeyingScreenOperation::KeyingScreenOperation()
|
||||
this->m_movieClip = nullptr;
|
||||
this->m_framenumber = 0;
|
||||
this->m_trackingObject[0] = 0;
|
||||
setComplex(true);
|
||||
flags.complex = true;
|
||||
}
|
||||
|
||||
void KeyingScreenOperation::initExecution()
|
||||
|
||||
@@ -27,7 +27,7 @@ MapUVOperation::MapUVOperation()
|
||||
this->addInputSocket(DataType::Vector);
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->m_alpha = 0.0f;
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
setResolutionInputSocketIndex(1);
|
||||
|
||||
this->m_inputUVProgram = nullptr;
|
||||
|
||||
@@ -26,7 +26,7 @@ NormalizeOperation::NormalizeOperation()
|
||||
this->addOutputSocket(DataType::Value);
|
||||
this->m_imageReader = nullptr;
|
||||
this->m_cachedInstance = nullptr;
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
}
|
||||
void NormalizeOperation::initExecution()
|
||||
{
|
||||
|
||||
@@ -70,11 +70,6 @@ class OutputSingleLayerOperation : public NodeOperation {
|
||||
{
|
||||
return CompositorPriority::Low;
|
||||
}
|
||||
|
||||
bool isFileOutputOperation() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* extra info for OpenEXR layers */
|
||||
@@ -129,11 +124,6 @@ class OutputOpenExrMultiLayerOperation : public NodeOperation {
|
||||
{
|
||||
return CompositorPriority::Low;
|
||||
}
|
||||
|
||||
bool isFileOutputOperation() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void add_exr_channels(void *exrhandle,
|
||||
|
||||
@@ -100,7 +100,7 @@ PlaneCornerPinMaskOperation::PlaneCornerPinMaskOperation() : m_corners_ready(fal
|
||||
* so we can use the initializeTileData function
|
||||
* to read corners from input sockets ...
|
||||
*/
|
||||
setComplex(true);
|
||||
flags.complex = true;
|
||||
}
|
||||
|
||||
void PlaneCornerPinMaskOperation::initExecution()
|
||||
|
||||
@@ -53,7 +53,7 @@ PlaneDistortWarpImageOperation::PlaneDistortWarpImageOperation()
|
||||
this->m_pixelReader = nullptr;
|
||||
this->m_motion_blur_samples = 1;
|
||||
this->m_motion_blur_shutter = 0.5f;
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
}
|
||||
|
||||
void PlaneDistortWarpImageOperation::calculateCorners(const float corners[4][2],
|
||||
|
||||
@@ -50,6 +50,7 @@ PreviewOperation::PreviewOperation(const ColorManagedViewSettings *viewSettings,
|
||||
this->m_displaySettings = displaySettings;
|
||||
this->m_defaultWidth = defaultWidth;
|
||||
this->m_defaultHeight = defaultHeight;
|
||||
flags.use_viewer_border = true;
|
||||
}
|
||||
|
||||
void PreviewOperation::verifyPreview(bNodeInstanceHash *previews, bNodeInstanceKey key)
|
||||
|
||||
@@ -27,7 +27,7 @@ ProjectorLensDistortionOperation::ProjectorLensDistortionOperation()
|
||||
this->addInputSocket(DataType::Color);
|
||||
this->addInputSocket(DataType::Value);
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
this->m_inputProgram = nullptr;
|
||||
this->m_dispersionAvailable = false;
|
||||
this->m_dispersion = 0.0f;
|
||||
|
||||
@@ -163,7 +163,7 @@ SMAAEdgeDetectionOperation::SMAAEdgeDetectionOperation()
|
||||
this->addInputSocket(DataType::Color); /* image */
|
||||
this->addInputSocket(DataType::Value); /* depth, material ID, etc. */
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
this->m_imageReader = nullptr;
|
||||
this->m_valueReader = nullptr;
|
||||
this->m_threshold = 0.1f;
|
||||
@@ -295,7 +295,7 @@ SMAABlendingWeightCalculationOperation::SMAABlendingWeightCalculationOperation()
|
||||
{
|
||||
this->addInputSocket(DataType::Color); /* edges */
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
this->m_imageReader = nullptr;
|
||||
this->m_corner_rounding = 25;
|
||||
}
|
||||
@@ -782,7 +782,7 @@ SMAANeighborhoodBlendingOperation::SMAANeighborhoodBlendingOperation()
|
||||
this->addInputSocket(DataType::Color); /* image */
|
||||
this->addInputSocket(DataType::Color); /* blend */
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
this->m_image1Reader = nullptr;
|
||||
this->m_image2Reader = nullptr;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ ScreenLensDistortionOperation::ScreenLensDistortionOperation()
|
||||
this->addInputSocket(DataType::Value);
|
||||
this->addInputSocket(DataType::Value);
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
this->m_inputProgram = nullptr;
|
||||
this->m_distortion = 0.0f;
|
||||
this->m_dispersion = 0.0f;
|
||||
|
||||
@@ -27,7 +27,7 @@ SunBeamsOperation::SunBeamsOperation()
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setResolutionInputSocketIndex(0);
|
||||
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
}
|
||||
|
||||
void SunBeamsOperation::initExecution()
|
||||
|
||||
@@ -37,7 +37,7 @@ TextureBaseOperation::TextureBaseOperation()
|
||||
this->m_rd = nullptr;
|
||||
this->m_pool = nullptr;
|
||||
this->m_sceneColorManage = false;
|
||||
setComplex(true);
|
||||
flags.complex = true;
|
||||
}
|
||||
TextureOperation::TextureOperation() : TextureBaseOperation()
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ TonemapOperation::TonemapOperation()
|
||||
this->m_imageReader = nullptr;
|
||||
this->m_data = nullptr;
|
||||
this->m_cachedInstance = nullptr;
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
}
|
||||
void TonemapOperation::initExecution()
|
||||
{
|
||||
|
||||
@@ -34,8 +34,8 @@ VariableSizeBokehBlurOperation::VariableSizeBokehBlurOperation()
|
||||
ResizeMode::None); // inverse search radius optimization structure.
|
||||
#endif
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setComplex(true);
|
||||
this->setOpenCL(true);
|
||||
flags.complex = true;
|
||||
flags.open_cl = true;
|
||||
|
||||
this->m_inputProgram = nullptr;
|
||||
this->m_inputBokehProgram = nullptr;
|
||||
@@ -282,7 +282,7 @@ InverseSearchRadiusOperation::InverseSearchRadiusOperation()
|
||||
{
|
||||
this->addInputSocket(DataType::Value, ResizeMode::None); // radius
|
||||
this->addOutputSocket(DataType::Color);
|
||||
this->setComplex(true);
|
||||
this->flags.complex = true;
|
||||
this->m_inputRadius = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ VectorBlurOperation::VectorBlurOperation()
|
||||
this->m_inputImageProgram = nullptr;
|
||||
this->m_inputSpeedProgram = nullptr;
|
||||
this->m_inputZProgram = nullptr;
|
||||
setComplex(true);
|
||||
flags.complex = true;
|
||||
}
|
||||
void VectorBlurOperation::initExecution()
|
||||
{
|
||||
|
||||
@@ -55,6 +55,7 @@ ViewerOperation::ViewerOperation()
|
||||
this->m_depthInput = nullptr;
|
||||
this->m_rd = nullptr;
|
||||
this->m_viewName = nullptr;
|
||||
flags.use_viewer_border = true;
|
||||
}
|
||||
|
||||
void ViewerOperation::initExecution()
|
||||
|
||||
@@ -63,7 +63,7 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int /*tileNumber*/
|
||||
MemoryBuffer *memoryBuffer = this->m_memoryProxy->getBuffer();
|
||||
float *buffer = memoryBuffer->getBuffer();
|
||||
const uint8_t num_channels = memoryBuffer->get_num_channels();
|
||||
if (this->m_input->isComplex()) {
|
||||
if (this->m_input->get_flags().complex) {
|
||||
void *data = this->m_input->initializeTileData(rect);
|
||||
int x1 = rect->xmin;
|
||||
int y1 = rect->ymin;
|
||||
|
||||
Reference in New Issue
Block a user