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.
This commit is contained in:
Sergey Sharybin
2016-04-22 10:55:26 +02:00
parent 31632e7f74
commit d2cb0f955b
9 changed files with 35 additions and 22 deletions

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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)

View File

@@ -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 */

View File

@@ -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");

View File

@@ -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);

View File

@@ -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);
};

View File

@@ -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);

View File

@@ -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)