diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-06-02 20:48:45 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-06-02 20:48:45 +0300 |
commit | 0465086223f16f650c6f64e7bcfac99612612c42 (patch) | |
tree | 61c37c09499e100bb6968f9e43e81b6825d3aa10 /intern/cycles | |
parent | 572c472754cac42e1a22ab8c098e3fd1d01e01d6 (diff) | |
parent | 52cc412e0f56f249d932e1025ea191939c1a6edb (diff) |
Merge branch 'blender-v2.83-release'
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/render/light.cpp | 22 | ||||
-rw-r--r-- | intern/cycles/render/light.h | 5 | ||||
-rw-r--r-- | intern/cycles/render/shader.cpp | 8 |
3 files changed, 11 insertions, 24 deletions
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp index f6979172dc8..76a2f17bd1b 100644 --- a/intern/cycles/render/light.cpp +++ b/intern/cycles/render/light.cpp @@ -182,7 +182,6 @@ bool Light::has_contribution(Scene *scene) LightManager::LightManager() { need_update = true; - need_update_background = true; use_light_visibility = false; } @@ -903,7 +902,7 @@ void LightManager::device_update(Device *device, VLOG(1) << "Total " << scene->lights.size() << " lights."; - device_free(device, dscene, need_update_background); + device_free(device, dscene); use_light_visibility = false; @@ -917,11 +916,9 @@ void LightManager::device_update(Device *device, if (progress.get_cancel()) return; - if (need_update_background) { - device_update_background(device, dscene, scene, progress); - if (progress.get_cancel()) - return; - } + device_update_background(device, dscene, scene, progress); + if (progress.get_cancel()) + return; device_update_ies(dscene); if (progress.get_cancel()) @@ -933,17 +930,14 @@ void LightManager::device_update(Device *device, } need_update = false; - need_update_background = false; } -void LightManager::device_free(Device *, DeviceScene *dscene, const bool free_background) +void LightManager::device_free(Device *, DeviceScene *dscene) { dscene->light_distribution.free(); dscene->lights.free(); - if (free_background) { - dscene->light_background_marginal_cdf.free(); - dscene->light_background_conditional_cdf.free(); - } + dscene->light_background_marginal_cdf.free(); + dscene->light_background_conditional_cdf.free(); dscene->ies_lights.free(); } @@ -996,7 +990,6 @@ int LightManager::add_ies(const string &content) ies_slots[slot]->hash = hash; need_update = true; - need_update_background = true; return slot; } @@ -1015,7 +1008,6 @@ void LightManager::remove_ies(int slot) /* If the slot has no more users, update the device to remove it. */ need_update |= (ies_slots[slot]->users == 0); - need_update_background |= need_update; } void LightManager::device_update_ies(DeviceScene *dscene) diff --git a/intern/cycles/render/light.h b/intern/cycles/render/light.h index 1a99b2b76ae..4f3048c1f32 100644 --- a/intern/cycles/render/light.h +++ b/intern/cycles/render/light.h @@ -88,9 +88,6 @@ class LightManager { bool use_light_visibility; bool need_update; - /* Need to update background (including multiple importance map) */ - bool need_update_background; - LightManager(); ~LightManager(); @@ -100,7 +97,7 @@ class LightManager { void remove_ies(int slot); void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress); - void device_free(Device *device, DeviceScene *dscene, const bool free_background = true); + void device_free(Device *device, DeviceScene *dscene); void tag_update(Scene *scene); diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp index 39ba45a751a..8403a636e1c 100644 --- a/intern/cycles/render/shader.cpp +++ b/intern/cycles/render/shader.cpp @@ -318,11 +318,9 @@ void Shader::tag_update(Scene *scene) * has use_mis set to false. We are quite close to release now, so * better to be safe. */ - if (this == scene->background->get_shader(scene)) { - scene->light_manager->need_update_background = true; - if (scene->light_manager->has_background_light(scene)) { - scene->light_manager->need_update = true; - } + if (this == scene->background->get_shader(scene) && + scene->light_manager->has_background_light(scene)) { + scene->light_manager->need_update = true; } /* quick detection of which kind of shaders we have to avoid loading |