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

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;