Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/render/scene.cpp')
-rw-r--r--intern/cycles/render/scene.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/intern/cycles/render/scene.cpp b/intern/cycles/render/scene.cpp
index 8f863b5d15f..e98b2c76e88 100644
--- a/intern/cycles/render/scene.cpp
+++ b/intern/cycles/render/scene.cpp
@@ -95,7 +95,8 @@ Scene::Scene(const SceneParams &params_, Device *device)
default_empty(NULL),
device(device),
dscene(device),
- params(params_)
+ params(params_),
+ update_stats(NULL)
{
memset((void *)&dscene.data, 0, sizeof(dscene.data));
@@ -188,6 +189,7 @@ void Scene::free_memory(bool final)
delete particle_system_manager;
delete image_manager;
delete bake_manager;
+ delete update_stats;
}
}
@@ -198,6 +200,20 @@ void Scene::device_update(Device *device_, Progress &progress)
bool print_stats = need_data_update();
+ if (update_stats) {
+ update_stats->clear();
+ }
+
+ scoped_callback_timer timer([this, print_stats](double time) {
+ if (update_stats) {
+ update_stats->scene.times.add_entry({"device_update", time});
+
+ if (print_stats) {
+ printf("Update statistics:\n%s\n", update_stats->full_report().c_str());
+ }
+ }
+ });
+
/* The order of updates is important, because there's dependencies between
* the different managers, using data computed by previous managers.
*
@@ -269,7 +285,7 @@ void Scene::device_update(Device *device_, Progress &progress)
return;
progress.set_status("Updating Lookup Tables");
- lookup_tables->device_update(device, &dscene);
+ lookup_tables->device_update(device, &dscene, this);
if (progress.get_cancel() || device->have_error())
return;
@@ -293,7 +309,7 @@ void Scene::device_update(Device *device_, Progress &progress)
return;
progress.set_status("Updating Lookup Tables");
- lookup_tables->device_update(device, &dscene);
+ lookup_tables->device_update(device, &dscene, this);
if (progress.get_cancel() || device->have_error())
return;
@@ -404,6 +420,13 @@ void Scene::collect_statistics(RenderStats *stats)
image_manager->collect_statistics(stats);
}
+void Scene::enable_update_stats()
+{
+ if (!update_stats) {
+ update_stats = new SceneUpdateStats();
+ }
+}
+
DeviceRequestedFeatures Scene::get_requested_device_features()
{
DeviceRequestedFeatures requested_features;