[Bf-blender-cvs] [c36e74892ee] cycles-x: Cycles X: Improve progress report while processing files from disk
Sergey Sharybin
noreply at git.blender.org
Mon Sep 20 17:00:05 CEST 2021
Commit: c36e74892ee8fd829e6d1ef4050f360ff9ed651a
Author: Sergey Sharybin
Date: Fri Sep 17 16:13:56 2021 +0200
Branches: cycles-x
https://developer.blender.org/rBc36e74892ee8fd829e6d1ef4050f360ff9ed651a
Cycles X: Improve progress report while processing files from disk
Differential Revision: https://developer.blender.org/D12542
===================================================================
M intern/cycles/blender/blender_session.cpp
M intern/cycles/integrator/path_trace.cpp
M intern/cycles/integrator/path_trace.h
===================================================================
diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp
index 5593ea0085b..bedbfd8bbc3 100644
--- a/intern/cycles/blender/blender_session.cpp
+++ b/intern/cycles/blender/blender_session.cpp
@@ -553,6 +553,11 @@ void BlenderSession::render(BL::Depsgraph &b_depsgraph_)
void BlenderSession::render_frame_finish()
{
+ /* Processing of all layers and views is done. Clear the strings so that we can communicate
+ * progress about reading files and denoising them. */
+ b_rlay_name = "";
+ b_rview_name = "";
+
if (!b_render.use_persistent_data()) {
/* Free the sync object so that it can properly dereference nodes from the scene graph before
* the graph is freed. */
diff --git a/intern/cycles/integrator/path_trace.cpp b/intern/cycles/integrator/path_trace.cpp
index dbeb6d0696c..a7481461dd0 100644
--- a/intern/cycles/integrator/path_trace.cpp
+++ b/intern/cycles/integrator/path_trace.cpp
@@ -807,6 +807,13 @@ void PathTrace::progress_update_if_needed(const RenderWork &render_work)
}
}
+void PathTrace::progress_set_status(const string &status, const string &substatus)
+{
+ if (progress_ != nullptr) {
+ progress_->set_status(status, substatus);
+ }
+}
+
void PathTrace::copy_to_render_buffers(RenderBuffers *render_buffers)
{
tbb::parallel_for_each(path_trace_works_,
@@ -846,10 +853,30 @@ bool PathTrace::copy_render_tile_from_device()
return success;
}
+static string get_layer_view_name(const RenderBuffers &buffers)
+{
+ string result;
+
+ if (buffers.params.layer.size()) {
+ result += string(buffers.params.layer);
+ }
+
+ if (buffers.params.view.size()) {
+ if (!result.empty()) {
+ result += ", ";
+ }
+ result += string(buffers.params.view);
+ }
+
+ return result;
+}
+
void PathTrace::process_full_buffer_from_disk(string_view filename)
{
VLOG(3) << "Processing full frame buffer file " << filename;
+ progress_set_status("Reading full buffer from disk");
+
RenderBuffers full_frame_buffers(cpu_device_.get());
DenoiseParams denoise_params;
@@ -858,9 +885,13 @@ void PathTrace::process_full_buffer_from_disk(string_view filename)
return;
}
+ const string layer_view_name = get_layer_view_name(full_frame_buffers);
+
render_state_.has_denoised_result = false;
if (denoise_params.use) {
+ progress_set_status(layer_view_name, "Denoising");
+
/* Re-use the denoiser as much as possible, avoiding possible device re-initialization.
*
* It will not conflict with the regular rendering as:
@@ -877,6 +908,8 @@ void PathTrace::process_full_buffer_from_disk(string_view filename)
full_frame_state_.render_buffers = &full_frame_buffers;
+ progress_set_status(layer_view_name, "Finishing");
+
/* Write the full result pretending that there is a single tile.
* Requires some state change, but allows to use same communication API with the software. */
tile_buffer_write();
diff --git a/intern/cycles/integrator/path_trace.h b/intern/cycles/integrator/path_trace.h
index 8e40c72211a..78ca68c1198 100644
--- a/intern/cycles/integrator/path_trace.h
+++ b/intern/cycles/integrator/path_trace.h
@@ -238,6 +238,8 @@ class PathTrace {
/* Run the progress_update_cb callback if it is needed. */
void progress_update_if_needed(const RenderWork &render_work);
+ void progress_set_status(const string &status, const string &substatus = "");
+
/* Pointer to a device which is configured to be used for path tracing. If multiple devices
* are configured this is a `MultiDevice`. */
Device *device_ = nullptr;
More information about the Bf-blender-cvs
mailing list