diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-22 11:55:26 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-22 11:55:26 +0300 |
commit | d2cb0f955b25857cb4f3fd28ebc4567f997d56b2 (patch) | |
tree | c2d2af62baaa3e6294d6493190b1be02d7b149e9 /intern/cycles/render | |
parent | 31632e7f74423aec01d64e3964200a03a70491d8 (diff) |
Cycles: Reduce verbosity of logging
Mainly makes logging less verbose when doing progressive sampling in viewport.
Such kind of verbosity is not really possible to be filtered out with `grep`
so let's reshuffle few lines of code.
Diffstat (limited to 'intern/cycles/render')
-rw-r--r-- | intern/cycles/render/light.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/render/mesh.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/render/object.cpp | 6 | ||||
-rw-r--r-- | intern/cycles/render/osl.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/render/particles.cpp | 6 | ||||
-rw-r--r-- | intern/cycles/render/scene.cpp | 20 | ||||
-rw-r--r-- | intern/cycles/render/scene.h | 5 | ||||
-rw-r--r-- | intern/cycles/render/svm.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/render/tables.cpp | 4 |
9 files changed, 35 insertions, 22 deletions
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp index 1637045ce84..fef28b25f3e 100644 --- a/intern/cycles/render/light.cpp +++ b/intern/cycles/render/light.cpp @@ -771,11 +771,11 @@ void LightManager::device_update_points(Device *device, void LightManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { - VLOG(1) << "Total " << scene->lights.size() << " lights."; - if(!need_update) return; + VLOG(1) << "Total " << scene->lights.size() << " lights."; + device_free(device, dscene); use_light_visibility = false; diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp index 990f725a5e3..cc8519219ed 100644 --- a/intern/cycles/render/mesh.cpp +++ b/intern/cycles/render/mesh.cpp @@ -1232,11 +1232,11 @@ void MeshManager::device_update_displacement_images(Device *device, void MeshManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { - VLOG(1) << "Total " << scene->meshes.size() << " meshes."; - if(!need_update) return; + VLOG(1) << "Total " << scene->meshes.size() << " meshes."; + /* update normals */ foreach(Mesh *mesh, scene->meshes) { foreach(uint shader, mesh->used_shaders) { diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp index c9cd6921a56..a7ea75820ea 100644 --- a/intern/cycles/render/object.cpp +++ b/intern/cycles/render/object.cpp @@ -480,11 +480,11 @@ void ObjectManager::device_update_transforms(Device *device, void ObjectManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { - VLOG(1) << "Total " << scene->objects.size() << " objects."; - if(!need_update) return; - + + VLOG(1) << "Total " << scene->objects.size() << " objects."; + device_free(device, dscene); if(scene->objects.size() == 0) diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp index e1c5416b024..cb3cb8b9b1b 100644 --- a/intern/cycles/render/osl.cpp +++ b/intern/cycles/render/osl.cpp @@ -75,11 +75,11 @@ void OSLShaderManager::reset(Scene * /*scene*/) void OSLShaderManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { - VLOG(1) << "Total " << scene->shaders.size() << " shaders."; - if(!need_update) return; + VLOG(1) << "Total " << scene->shaders.size() << " shaders."; + device_free(device, dscene, scene); /* determine which shaders are in use */ diff --git a/intern/cycles/render/particles.cpp b/intern/cycles/render/particles.cpp index 8f9e8c6d639..50726bb4574 100644 --- a/intern/cycles/render/particles.cpp +++ b/intern/cycles/render/particles.cpp @@ -93,12 +93,12 @@ void ParticleSystemManager::device_update_particles(Device *device, DeviceScene void ParticleSystemManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { + if(!need_update) + return; + VLOG(1) << "Total " << scene->particle_systems.size() << " particle systems."; - if(!need_update) - return; - device_free(device, dscene); progress.set_status("Updating Particle Systems", "Copying Particles to device"); diff --git a/intern/cycles/render/scene.cpp b/intern/cycles/render/scene.cpp index 29163c53109..b0052c30af4 100644 --- a/intern/cycles/render/scene.cpp +++ b/intern/cycles/render/scene.cpp @@ -135,7 +135,9 @@ void Scene::device_update(Device *device_, Progress& progress) { if(!device) device = device_; - + + bool print_stats = need_data_update(); + /* The order of updates is important, because there's dependencies between * the different managers, using data computed by previous managers. * @@ -239,9 +241,11 @@ void Scene::device_update(Device *device_, Progress& progress) device->const_copy_to("__data", &dscene.data, sizeof(dscene.data)); } - VLOG(1) << "System memory statistics after full device sync:\n" - << " Usage: " << util_guarded_get_mem_used() << "\n" - << " Peak: " << util_guarded_get_mem_peak(); + if(print_stats) { + VLOG(1) << "System memory statistics after full device sync:\n" + << " Usage: " << util_guarded_get_mem_used() << "\n" + << " Peak: " << util_guarded_get_mem_peak(); + } } Scene::MotionType Scene::need_motion(bool advanced_shading) @@ -278,11 +282,10 @@ bool Scene::need_update() return (need_reset() || film->need_update); } -bool Scene::need_reset() +bool Scene::need_data_update() { return (background->need_update || image_manager->need_update - || camera->need_update || object_manager->need_update || mesh_manager->need_update || light_manager->need_update @@ -295,6 +298,11 @@ bool Scene::need_reset() || film->need_update); } +bool Scene::need_reset() +{ + return need_data_update() || camera->need_update; +} + void Scene::reset() { shader_manager->reset(this); diff --git a/intern/cycles/render/scene.h b/intern/cycles/render/scene.h index d30a0cb45fe..b29aff88c01 100644 --- a/intern/cycles/render/scene.h +++ b/intern/cycles/render/scene.h @@ -213,6 +213,11 @@ public: void device_free(); protected: + /* Check if some heavy data worth logging was updated. + * Mainly used to suppress extra annoying logging. + */ + bool need_data_update(); + void free_memory(bool final); }; diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp index f3d39c1bd72..56fb57e9667 100644 --- a/intern/cycles/render/svm.cpp +++ b/intern/cycles/render/svm.cpp @@ -46,11 +46,11 @@ void SVMShaderManager::reset(Scene * /*scene*/) void SVMShaderManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) { - VLOG(1) << "Total " << scene->shaders.size() << " shaders."; - if(!need_update) return; + VLOG(1) << "Total " << scene->shaders.size() << " shaders."; + /* test if we need to update */ device_free(device, dscene, scene); diff --git a/intern/cycles/render/tables.cpp b/intern/cycles/render/tables.cpp index ad3f4866072..cde024cc11c 100644 --- a/intern/cycles/render/tables.cpp +++ b/intern/cycles/render/tables.cpp @@ -37,11 +37,11 @@ LookupTables::~LookupTables() void LookupTables::device_update(Device *device, DeviceScene *dscene) { - VLOG(1) << "Total " << lookup_tables.size() << " lookup tables."; - if(!need_update) return; + VLOG(1) << "Total " << lookup_tables.size() << " lookup tables."; + device->tex_free(dscene->lookup_table); if(lookup_tables.size() > 0) |