Cycles: Fix access uninitialized light after recent refactor/fixes

This commit is contained in:
Sergey Sharybin 2016-02-07 06:18:51 +05:00
parent 76eac1ae70
commit 578f70f288
Notes: blender-bot 2023-02-14 08:25:14 +01:00
Referenced by issue #47388, smoke render viewport vs final render
Referenced by issue #47366, New Curve interpolation in Color Management works as the old method unless it gets reset.
Referenced by issue #47353, texture paint grid bug
Referenced by issue #47356, Possible errors introduced in the new SSS implementation (in the days after it was committed)
1 changed files with 2 additions and 2 deletions

View File

@ -206,7 +206,7 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
bool background_mis = false;
foreach(Light *light, scene->lights) {
if(light->has_contribution(scene))
if(light->is_enabled)
num_lights++;
}
@ -345,7 +345,7 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
int light_index = 0;
foreach(Light *light, scene->lights) {
if(!light->has_contribution(scene))
if(!light->is_enabled)
continue;
distribution[offset].x = totarea;