Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorManuel Castilla <manzanillawork@gmail.com>2021-08-20 16:31:47 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-08-20 16:31:47 +0300
commit31fc76fa5b42b1b4d303cc3eb256c44b3da60f36 (patch)
tree987dac5409e16214d9fc3c0ec17ddcc327ef71b6 /source
parentf669932c93226c2bdbf45d6fb6827ff349643772 (diff)
Compositor: Do not register constant input areas for rendering
If an input is only used as a constant it doesn't rendering because its already calculated after constant folding.
Diffstat (limited to 'source')
-rw-r--r--source/blender/compositor/COM_defines.h2
-rw-r--r--source/blender/compositor/intern/COM_FullFrameExecutionModel.cc4
-rw-r--r--source/blender/compositor/operations/COM_BlurBaseOperation.cc2
-rw-r--r--source/blender/compositor/operations/COM_BokehBlurOperation.cc2
-rw-r--r--source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc2
-rw-r--r--source/blender/compositor/operations/COM_RotateOperation.cc2
-rw-r--r--source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cc2
-rw-r--r--source/blender/compositor/operations/COM_TransformOperation.cc2
9 files changed, 12 insertions, 10 deletions
diff --git a/source/blender/compositor/COM_defines.h b/source/blender/compositor/COM_defines.h
index e270eeb3386..0c477eb2584 100644
--- a/source/blender/compositor/COM_defines.h
+++ b/source/blender/compositor/COM_defines.h
@@ -121,7 +121,7 @@ constexpr float COM_PREVIEW_SIZE = 140.f;
constexpr float COM_RULE_OF_THIRDS_DIVIDER = 100.0f;
constexpr float COM_BLUR_BOKEH_PIXELS = 512;
-constexpr rcti COM_SINGLE_ELEM_AREA = {0, 1, 0, 1};
+constexpr rcti COM_CONSTANT_INPUT_AREA_OF_INTEREST = {0, 0, 0, 0};
constexpr IndexRange XRange(const rcti &area)
{
diff --git a/source/blender/compositor/intern/COM_FullFrameExecutionModel.cc b/source/blender/compositor/intern/COM_FullFrameExecutionModel.cc
index bd3a481d691..71295f38c5b 100644
--- a/source/blender/compositor/intern/COM_FullFrameExecutionModel.cc
+++ b/source/blender/compositor/intern/COM_FullFrameExecutionModel.cc
@@ -206,7 +206,9 @@ void FullFrameExecutionModel::determine_areas_to_render(NodeOperation *output_op
/* Ensure area of interest is within operation bounds, cropping areas outside. */
BLI_rcti_isect(&input_area, &input_op_rect, &input_area);
- stack.append({input_op, input_area});
+ if (!BLI_rcti_is_empty(&input_area)) {
+ stack.append({input_op, input_area});
+ }
}
}
}
diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.cc b/source/blender/compositor/operations/COM_BlurBaseOperation.cc
index a1075e9feb9..d3714459bc8 100644
--- a/source/blender/compositor/operations/COM_BlurBaseOperation.cc
+++ b/source/blender/compositor/operations/COM_BlurBaseOperation.cc
@@ -256,7 +256,7 @@ void BlurBaseOperation::get_area_of_interest(const int input_idx,
r_input_area = output_area;
break;
case 1:
- r_input_area = use_variable_size_ ? output_area : COM_SINGLE_ELEM_AREA;
+ r_input_area = use_variable_size_ ? output_area : COM_CONSTANT_INPUT_AREA_OF_INTEREST;
break;
}
}
diff --git a/source/blender/compositor/operations/COM_BokehBlurOperation.cc b/source/blender/compositor/operations/COM_BokehBlurOperation.cc
index a0172fabde4..dc13b3253ba 100644
--- a/source/blender/compositor/operations/COM_BokehBlurOperation.cc
+++ b/source/blender/compositor/operations/COM_BokehBlurOperation.cc
@@ -327,7 +327,7 @@ void BokehBlurOperation::get_area_of_interest(const int input_idx,
r_input_area = output_area;
break;
case SIZE_INPUT_INDEX: {
- r_input_area = COM_SINGLE_ELEM_AREA;
+ r_input_area = COM_CONSTANT_INPUT_AREA_OF_INTEREST;
break;
}
}
diff --git a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc
index 80baa779be1..76dfbf95d45 100644
--- a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc
+++ b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc
@@ -225,7 +225,7 @@ void PlaneCornerPinMaskOperation::get_area_of_interest(const int UNUSED(input_id
rcti &r_input_area)
{
/* All corner inputs are used as constants. */
- r_input_area = COM_SINGLE_ELEM_AREA;
+ r_input_area = COM_CONSTANT_INPUT_AREA_OF_INTEREST;
}
/* ******** PlaneCornerPinWarpImageOperation ******** */
@@ -322,7 +322,7 @@ void PlaneCornerPinWarpImageOperation::get_area_of_interest(const int input_idx,
}
else {
/* Corner inputs are used as constants. */
- r_input_area = COM_SINGLE_ELEM_AREA;
+ r_input_area = COM_CONSTANT_INPUT_AREA_OF_INTEREST;
}
}
diff --git a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc
index fcab5dd5751..faebaf657cc 100644
--- a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc
+++ b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc
@@ -137,7 +137,7 @@ void ProjectorLensDistortionOperation::get_area_of_interest(const int input_idx,
{
if (input_idx == 1) {
/* Dispersion input is used as constant only. */
- r_input_area = COM_SINGLE_ELEM_AREA;
+ r_input_area = COM_CONSTANT_INPUT_AREA_OF_INTEREST;
return;
}
diff --git a/source/blender/compositor/operations/COM_RotateOperation.cc b/source/blender/compositor/operations/COM_RotateOperation.cc
index 842bfcfdbfd..5ba3153ff6c 100644
--- a/source/blender/compositor/operations/COM_RotateOperation.cc
+++ b/source/blender/compositor/operations/COM_RotateOperation.cc
@@ -165,7 +165,7 @@ void RotateOperation::get_area_of_interest(const int input_idx,
{
if (input_idx == 1) {
/* Degrees input is always used as constant. */
- r_input_area = COM_SINGLE_ELEM_AREA;
+ r_input_area = COM_CONSTANT_INPUT_AREA_OF_INTEREST;
return;
}
diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cc b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cc
index f9ba2ef69ad..211c037851b 100644
--- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cc
+++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cc
@@ -388,7 +388,7 @@ void ScreenLensDistortionOperation::get_area_of_interest(const int input_idx,
{
if (input_idx != 0) {
/* Dispersion and distorsion inputs are used as constants only. */
- r_input_area = COM_SINGLE_ELEM_AREA;
+ r_input_area = COM_CONSTANT_INPUT_AREA_OF_INTEREST;
}
/* XXX the original method of estimating the area-of-interest does not work
diff --git a/source/blender/compositor/operations/COM_TransformOperation.cc b/source/blender/compositor/operations/COM_TransformOperation.cc
index 9d00b7eec49..0feca07ac82 100644
--- a/source/blender/compositor/operations/COM_TransformOperation.cc
+++ b/source/blender/compositor/operations/COM_TransformOperation.cc
@@ -101,7 +101,7 @@ void TransformOperation::get_area_of_interest(const int input_idx,
case 2:
case 3: {
/* Translation x/y and rotation degrees are always constant. */
- r_input_area = COM_SINGLE_ELEM_AREA;
+ r_input_area = COM_CONSTANT_INPUT_AREA_OF_INTEREST;
return;
}
case 4: {