[Bf-blender-cvs] [9b48f2b] master: Cycles: Improvements and fixes for the resumable render
Sergey Sharybin
noreply at git.blender.org
Tue Apr 19 13:03:37 CEST 2016
Commit: 9b48f2b27c0f64c7f8cc452ad3820f705c15495d
Author: Sergey Sharybin
Date: Tue Apr 19 12:54:29 2016 +0200
Branches: master
https://developer.blender.org/rB9b48f2b27c0f64c7f8cc452ad3820f705c15495d
Cycles: Improvements and fixes for the resumable render
- Fix wrong current sample reported in the log
- Also includes fix for progressive refine log
- Explicitly print to the stdout that resumable render is enabled
- Print error message and abort when passing wrong values for the
resumable render. Never waste someone's compute power for wrong
render!
Fixes T48185: Cycles resumable num chunks breaks sample counter
===================================================================
M intern/cycles/blender/blender_python.cpp
M intern/cycles/render/session.cpp
===================================================================
diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp
index 989ba80..ceb9cbf 100644
--- a/intern/cycles/blender/blender_python.cpp
+++ b/intern/cycles/blender/blender_python.cpp
@@ -644,7 +644,20 @@ static PyObject *set_resumable_chunks_func(PyObject * /*self*/, PyObject *args)
if(!PyArg_ParseTuple(args, "ii",
&num_resumable_chunks,
¤t_resumable_chunk)) {
- return NULL;
+ Py_RETURN_NONE;
+ }
+
+ if(num_resumable_chunks <= 0) {
+ fprintf(stderr, "Cycles: Bad value for number of resumable chunks.\n");
+ abort();
+ Py_RETURN_NONE;
+ }
+ if(current_resumable_chunk < 1 ||
+ current_resumable_chunk > num_resumable_chunks)
+ {
+ fprintf(stderr, "Cycles: Bad value for current resumable chunk number.\n");
+ abort();
+ Py_RETURN_NONE;
}
VLOG(1) << "Initialized resumable render: "
@@ -653,6 +666,10 @@ static PyObject *set_resumable_chunks_func(PyObject * /*self*/, PyObject *args)
BlenderSession::num_resumable_chunks = num_resumable_chunks;
BlenderSession::current_resumable_chunk = current_resumable_chunk;
+ printf("Cycles: Will render chunk %d of %d\n",
+ current_resumable_chunk,
+ num_resumable_chunks);
+
Py_RETURN_NONE;
}
diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
index 84a420c..24f48b6 100644
--- a/intern/cycles/render/session.cpp
+++ b/intern/cycles/render/session.cpp
@@ -831,7 +831,8 @@ void Session::update_status_time(bool show_pause, bool show_done)
string status, substatus;
if(!params.progressive) {
- const int progress_sample = progress.get_sample(), num_samples = tile_manager.num_samples;
+ const int progress_sample = progress.get_sample(),
+ num_samples = tile_manager.get_num_effective_samples();
const bool is_gpu = params.device.type == DEVICE_CUDA || params.device.type == DEVICE_OPENCL;
const bool is_multidevice = params.device.multi_devices.size() > 1;
const bool is_cpu = params.device.type == DEVICE_CPU;
@@ -873,7 +874,9 @@ void Session::update_status_time(bool show_pause, bool show_done)
else if(tile_manager.num_samples == INT_MAX)
substatus = string_printf("Path Tracing Sample %d", sample+1);
else
- substatus = string_printf("Path Tracing Sample %d/%d", sample+1, tile_manager.num_samples);
+ substatus = string_printf("Path Tracing Sample %d/%d",
+ sample+1,
+ tile_manager.get_num_effective_samples());
if(show_pause) {
status = "Paused";
More information about the Bf-blender-cvs
mailing list