Fix T38526: crash using blackbody node on background with multiple importance sampling.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 6 Feb 2014 20:09:46 +0000 (21:09 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 6 Feb 2014 20:10:22 +0000 (21:10 +0100)
intern/cycles/render/scene.cpp

index da790b6fcc9be4ddb65eda934b4c75cf4630e303..71f5a9dafed7a4454558847c71e3babbbc045d86 100644 (file)
@@ -136,7 +136,7 @@ void Scene::device_update(Device *device_, Progress& progress)
         * - Image manager uploads images used by shaders.
         * - Camera may be used for adapative subdivison.
         * - Displacement shader must have all shader data available.
-        * - Light manager needs final mesh data to compute emission CDF.
+        * - Light manager needs lookup tables and final mesh data to compute emission CDF.
         */
        
        image_manager->set_pack_images(device->info.pack_images);
@@ -171,6 +171,16 @@ void Scene::device_update(Device *device_, Progress& progress)
 
        if(progress.get_cancel()) return;
 
+       progress.set_status("Updating Film");
+       film->device_update(device, &dscene, this);
+
+       if(progress.get_cancel()) return;
+
+       progress.set_status("Updating Lookup Tables");
+       lookup_tables->device_update(device, &dscene);
+
+       if(progress.get_cancel()) return;
+
        progress.set_status("Updating Meshes");
        mesh_manager->device_update(device, &dscene, this, progress);
 
@@ -186,21 +196,11 @@ void Scene::device_update(Device *device_, Progress& progress)
 
        if(progress.get_cancel()) return;
 
-       progress.set_status("Updating Film");
-       film->device_update(device, &dscene, this);
-
-       if(progress.get_cancel()) return;
-
        progress.set_status("Updating Integrator");
        integrator->device_update(device, &dscene, this);
 
        if(progress.get_cancel()) return;
 
-       progress.set_status("Updating Lookup Tables");
-       lookup_tables->device_update(device, &dscene);
-
-       if(progress.get_cancel()) return;
-
        progress.set_status("Updating Device", "Writing constant memory");
        device->const_copy_to("__data", &dscene.data, sizeof(dscene.data));
 }