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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2021-01-29 19:17:18 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2021-01-29 19:35:28 +0300
commitd0f59d38429d945b3215890897eb2cfb90eacaa7 (patch)
treef3ddebd94b9f7dd4b54ec3523d95bcea11df1958 /intern/cycles/render/integrator.cpp
parent171f2e4949837ca3537d9b998a42590fd88c5ad8 (diff)
Fix T85144: Cycles crashes when editing render properties in viewport
rendering Issue was caused by the sample pattern LUT always being freed and not rebuilt when properties driving its dimensions were modified.
Diffstat (limited to 'intern/cycles/render/integrator.cpp')
-rw-r--r--intern/cycles/render/integrator.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/intern/cycles/render/integrator.cpp b/intern/cycles/render/integrator.cpp
index c97a6549653..d93856ceb61 100644
--- a/intern/cycles/render/integrator.cpp
+++ b/intern/cycles/render/integrator.cpp
@@ -115,7 +115,15 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
}
});
- if (sampling_pattern_is_modified()) {
+ const bool need_update_lut = ao_samples_is_modified() || diffuse_samples_is_modified() ||
+ glossy_samples_is_modified() || max_bounce_is_modified() ||
+ max_transmission_bounce_is_modified() ||
+ mesh_light_samples_is_modified() || method_is_modified() ||
+ sampling_pattern_is_modified() ||
+ subsurface_samples_is_modified() ||
+ transmission_samples_is_modified() || volume_samples_is_modified();
+
+ if (need_update_lut) {
dscene->sample_pattern_lut.tag_realloc();
}
@@ -248,7 +256,7 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
int dimensions = PRNG_BASE_NUM + max_samples * PRNG_BOUNCE_NUM;
dimensions = min(dimensions, SOBOL_MAX_DIMENSIONS);
- if (sampling_pattern_is_modified()) {
+ if (need_update_lut) {
if (sampling_pattern == SAMPLING_PATTERN_SOBOL) {
uint *directions = dscene->sample_pattern_lut.alloc(SOBOL_BITS * dimensions);
@@ -272,6 +280,7 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
}
}
+ dscene->sample_pattern_lut.clear_modified();
clear_modified();
}
@@ -292,6 +301,11 @@ void Integrator::tag_update(Scene *scene, uint32_t flag)
tag_ao_bounces_modified();
}
+ if ((flag & LIGHT_SAMPLES_MODIFIED) && (method == BRANCHED_PATH)) {
+ /* the number of light samples may affect the size of the sample_pattern_lut */
+ tag_sampling_pattern_modified();
+ }
+
if (filter_glossy_is_modified()) {
foreach (Shader *shader, scene->shaders) {
if (shader->has_integrator_dependency) {