Cycles: Fix access uninitialized light after recent refactor/fixes
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 7 Feb 2016 01:18:51 +0000 (06:18 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 7 Feb 2016 01:20:06 +0000 (06:20 +0500)
intern/cycles/render/light.cpp

index 8bb5fec959f5ab800542aafaeab35ee81ccbc128..1637045ce84bf496099778937c34693bf1a7f756 100644 (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;