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:
authorPatrick Mours <pmours@nvidia.com>2019-10-29 18:32:53 +0300
committerPatrick Mours <pmours@nvidia.com>2019-11-04 20:09:56 +0300
commitb45828ebe9c6e729c5d65bb23f913088f3f8672c (patch)
tree819041cc892fd34d10567f8a9b9682034c59d20f /intern/cycles/render/light.cpp
parent8ab6ef30ab28e6c73fc9309c0b21ddbc1cd3afc9 (diff)
Fix T71123: OptiX error in Cycles viewport when adding HDRI
Cycles did not update the "is_enabled" flag on lights when they were synchronized again, which caused all lights disabled by "LightManager::disable_ineffective_light" to be disabled indefinitely. As a result the OptiX kernels were not reloaded with correct features when a change to a light was made. This fixes that by updating the "is_enabled" flag during synchronization. Differential Revision: https://developer.blender.org/D6141
Diffstat (limited to 'intern/cycles/render/light.cpp')
-rw-r--r--intern/cycles/render/light.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp
index 8c7a21da561..dc3f7c8f8ac 100644
--- a/intern/cycles/render/light.cpp
+++ b/intern/cycles/render/light.cpp
@@ -221,13 +221,11 @@ void LightManager::disable_ineffective_light(Scene *scene)
*/
Shader *shader = (scene->background->shader) ? scene->background->shader :
scene->default_background;
- bool disable_mis = !(has_portal || shader->has_surface_spatial_varying);
- if (disable_mis) {
- VLOG(1) << "Background MIS has been disabled.\n";
- foreach (Light *light, scene->lights) {
- if (light->type == LIGHT_BACKGROUND) {
- light->is_enabled = false;
- }
+ const bool disable_mis = !(has_portal || shader->has_surface_spatial_varying);
+ VLOG_IF(1, disable_mis) << "Background MIS has been disabled.\n";
+ foreach (Light *light, scene->lights) {
+ if (light->type == LIGHT_BACKGROUND) {
+ light->is_enabled = !disable_mis;
}
}
}