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
diff options
context:
space:
mode:
authorLukas Stockner <lukas.stockner@freenet.de>2017-02-01 07:43:17 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2017-02-01 07:43:17 +0300
commitfa19940dc63d22cc03e1411e2add8ec8647b5f28 (patch)
tree2b444bf4bc42f5a3667c5df8cc9c802a05b8a9eb
parent92258f3678b464894479a2939d848341394bfcd1 (diff)
Cycles: Fix rng_state initialization when using resumable rendering
-rw-r--r--intern/cycles/blender/blender_session.cpp3
-rw-r--r--intern/cycles/kernel/kernel_path_common.h2
-rw-r--r--intern/cycles/kernel/kernel_types.h3
-rw-r--r--intern/cycles/render/integrator.cpp2
-rw-r--r--intern/cycles/render/integrator.h1
5 files changed, 10 insertions, 1 deletions
diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp
index 04b5c3fa013..2f30cbd961f 100644
--- a/intern/cycles/blender/blender_session.cpp
+++ b/intern/cycles/blender/blender_session.cpp
@@ -1352,6 +1352,9 @@ void BlenderSession::update_resumable_tile_manager(int num_samples)
VLOG(1) << "Samples range start is " << range_start_sample << ", "
<< "number of samples to render is " << range_num_samples;
+ scene->integrator->start_sample = range_start_sample;
+ scene->integrator->tag_update(scene);
+
session->tile_manager.range_start_sample = range_start_sample;
session->tile_manager.range_num_samples = range_num_samples;
}
diff --git a/intern/cycles/kernel/kernel_path_common.h b/intern/cycles/kernel/kernel_path_common.h
index 13597eab287..7b903556bf9 100644
--- a/intern/cycles/kernel/kernel_path_common.h
+++ b/intern/cycles/kernel/kernel_path_common.h
@@ -30,7 +30,7 @@ ccl_device_inline void kernel_path_trace_setup(KernelGlobals *kg,
int num_samples = kernel_data.integrator.aa_samples;
- if(sample == 0) {
+ if(sample == kernel_data.integrator.start_sample) {
*rng_state = hash_int_2d(x, y);
}
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 4d9c4b2e6f1..8c271c75e44 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -1187,6 +1187,9 @@ typedef struct KernelIntegrator {
int volume_samples;
float light_inv_rr_threshold;
+
+ int start_sample;
+ int pad1, pad2, pad3;
} KernelIntegrator;
static_assert_align(KernelIntegrator, 16);
diff --git a/intern/cycles/render/integrator.cpp b/intern/cycles/render/integrator.cpp
index 41e1dae2745..1ab0f9874f2 100644
--- a/intern/cycles/render/integrator.cpp
+++ b/intern/cycles/render/integrator.cpp
@@ -64,6 +64,7 @@ NODE_DEFINE(Integrator)
SOCKET_INT(mesh_light_samples, "Mesh Light Samples", 1);
SOCKET_INT(subsurface_samples, "Subsurface Samples", 1);
SOCKET_INT(volume_samples, "Volume Samples", 1);
+ SOCKET_INT(start_sample, "Start Sample", 0);
SOCKET_BOOLEAN(sample_all_lights_direct, "Sample All Lights Direct", true);
SOCKET_BOOLEAN(sample_all_lights_indirect, "Sample All Lights Indirect", true);
@@ -161,6 +162,7 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
kintegrator->mesh_light_samples = mesh_light_samples;
kintegrator->subsurface_samples = subsurface_samples;
kintegrator->volume_samples = volume_samples;
+ kintegrator->start_sample = start_sample;
if(method == BRANCHED_PATH) {
kintegrator->sample_all_lights_direct = sample_all_lights_direct;
diff --git a/intern/cycles/render/integrator.h b/intern/cycles/render/integrator.h
index f8cc0507ada..27fff4831e5 100644
--- a/intern/cycles/render/integrator.h
+++ b/intern/cycles/render/integrator.h
@@ -66,6 +66,7 @@ public:
int mesh_light_samples;
int subsurface_samples;
int volume_samples;
+ int start_sample;
bool sample_all_lights_direct;
bool sample_all_lights_indirect;