[Bf-blender-cvs] [2f5dd83] master: Cycles: Add some statistics logging

Sergey Sharybin noreply at git.blender.org
Fri Apr 10 12:39:58 CEST 2015


Commit: 2f5dd83759d2db8480706c3a472bdf0f7db4f725
Author: Sergey Sharybin
Date:   Fri Apr 10 15:36:56 2015 +0500
Branches: master
https://developer.blender.org/rB2f5dd83759d2db8480706c3a472bdf0f7db4f725

Cycles: Add some statistics logging

Covers number of entities in the scene (objects, meshes etc), also reports
sizes of textures being allocated.

===================================================================

M	intern/cycles/device/device_cpu.cpp
M	intern/cycles/device/device_cuda.cpp
M	intern/cycles/device/device_multi.cpp
M	intern/cycles/device/device_network.cpp
M	intern/cycles/device/device_opencl.cpp
M	intern/cycles/render/light.cpp
M	intern/cycles/render/mesh.cpp
M	intern/cycles/render/object.cpp
M	intern/cycles/render/osl.cpp
M	intern/cycles/render/particles.cpp
M	intern/cycles/render/svm.cpp
M	intern/cycles/render/tables.cpp

===================================================================

diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp
index 148e52e..63735df 100644
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@ -38,6 +38,7 @@
 #include "util_debug.h"
 #include "util_foreach.h"
 #include "util_function.h"
+#include "util_logging.h"
 #include "util_opengl.h"
 #include "util_progress.h"
 #include "util_system.h"
@@ -115,6 +116,7 @@ public:
 
 	void tex_alloc(const char *name, device_memory& mem, InterpolationType interpolation, bool /*periodic*/)
 	{
+		VLOG(1) << "Texture allocate: " << name << ", " << mem.memory_size() << " bytes.";
 		kernel_tex_copy(&kernel_globals, name, mem.data_pointer, mem.data_width, mem.data_height, mem.data_depth, interpolation);
 		mem.device_pointer = mem.data_pointer;
 		mem.device_size = mem.memory_size();
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 5afeb89..9d3b16b 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -419,6 +419,7 @@ public:
 	void tex_alloc(const char *name, device_memory& mem, InterpolationType interpolation, bool periodic)
 	{
 		/* todo: support 3D textures, only CPU for now */
+		VLOG(1) << "Texture allocate: " << name << ", " << mem.memory_size() << " bytes.";
 
 		/* determine format */
 		CUarray_format_enum format;
diff --git a/intern/cycles/device/device_multi.cpp b/intern/cycles/device/device_multi.cpp
index 9aac86d..8da489a 100644
--- a/intern/cycles/device/device_multi.cpp
+++ b/intern/cycles/device/device_multi.cpp
@@ -25,6 +25,7 @@
 
 #include "util_foreach.h"
 #include "util_list.h"
+#include "util_logging.h"
 #include "util_map.h"
 #include "util_time.h"
 
@@ -170,6 +171,8 @@ public:
 
 	void tex_alloc(const char *name, device_memory& mem, InterpolationType interpolation, bool periodic)
 	{
+		VLOG(1) << "Texture allocate: " << name << ", " << mem.memory_size() << " bytes.";
+
 		foreach(SubDevice& sub, devices) {
 			mem.device_pointer = 0;
 			sub.device->tex_alloc(name, mem, interpolation, periodic);
diff --git a/intern/cycles/device/device_network.cpp b/intern/cycles/device/device_network.cpp
index 20df243..90cd6a7 100644
--- a/intern/cycles/device/device_network.cpp
+++ b/intern/cycles/device/device_network.cpp
@@ -164,6 +164,8 @@ public:
 
 	void tex_alloc(const char *name, device_memory& mem, InterpolationType interpolation, bool periodic)
 	{
+		VLOG(1) << "Texture allocate: " << name << ", " << mem.memory_size() << " bytes.";
+
 		thread_scoped_lock lock(rpc_lock);
 
 		mem.device_pointer = ++mem_counter;
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp
index a77a6aa..1147cbd 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -28,6 +28,7 @@
 #include "buffers.h"
 
 #include "util_foreach.h"
+#include "util_logging.h"
 #include "util_map.h"
 #include "util_math.h"
 #include "util_md5.h"
@@ -859,6 +860,7 @@ public:
 	               InterpolationType /*interpolation*/,
 	               bool /*periodic*/)
 	{
+		VLOG(1) << "Texture allocate: " << name << ", " << mem.memory_size() << " bytes.";
 		mem_alloc(mem, MEM_READ_ONLY);
 		mem_copy_to(mem);
 		assert(mem_map.find(name) == mem_map.end());
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp
index 08ee8ed..91e45ae 100644
--- a/intern/cycles/render/light.cpp
+++ b/intern/cycles/render/light.cpp
@@ -662,6 +662,8 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce
 
 void LightManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress)
 {
+	VLOG(1) << "Total " << scene->lights.size() << " lights.";
+
 	if(!need_update)
 		return;
 
diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp
index 6cf75a2..74ea3c9 100644
--- a/intern/cycles/render/mesh.cpp
+++ b/intern/cycles/render/mesh.cpp
@@ -1150,6 +1150,8 @@ void MeshManager::device_update_flags(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;
 
diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp
index a1d0439..6650b42 100644
--- a/intern/cycles/render/object.cpp
+++ b/intern/cycles/render/object.cpp
@@ -23,6 +23,7 @@
 #include "scene.h"
 
 #include "util_foreach.h"
+#include "util_logging.h"
 #include "util_map.h"
 #include "util_progress.h"
 #include "util_vector.h"
@@ -377,6 +378,8 @@ void ObjectManager::device_update_transforms(Device *device, DeviceScene *dscene
 
 void ObjectManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress)
 {
+	VLOG(1) << "Total " << scene->objects.size() << " objects.";
+
 	if(!need_update)
 		return;
 	
diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp
index 679d54d..cd6c6eb 100644
--- a/intern/cycles/render/osl.cpp
+++ b/intern/cycles/render/osl.cpp
@@ -75,6 +75,8 @@ 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;
 
diff --git a/intern/cycles/render/particles.cpp b/intern/cycles/render/particles.cpp
index f6a89d7..8f9e8c6 100644
--- a/intern/cycles/render/particles.cpp
+++ b/intern/cycles/render/particles.cpp
@@ -19,6 +19,7 @@
 #include "scene.h"
 
 #include "util_foreach.h"
+#include "util_logging.h"
 #include "util_map.h"
 #include "util_progress.h"
 #include "util_vector.h"
@@ -92,6 +93,9 @@ void ParticleSystemManager::device_update_particles(Device *device, DeviceScene
 
 void ParticleSystemManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress)
 {
+	VLOG(1) << "Total " << scene->particle_systems.size()
+	        << " particle systems.";
+
 	if(!need_update)
 		return;
 	
diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp
index f5264de..6f7cffa 100644
--- a/intern/cycles/render/svm.cpp
+++ b/intern/cycles/render/svm.cpp
@@ -24,6 +24,7 @@
 #include "svm.h"
 
 #include "util_debug.h"
+#include "util_logging.h"
 #include "util_foreach.h"
 #include "util_progress.h"
 
@@ -45,6 +46,8 @@ 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;
 
diff --git a/intern/cycles/render/tables.cpp b/intern/cycles/render/tables.cpp
index faf7ea3..ad3f486 100644
--- a/intern/cycles/render/tables.cpp
+++ b/intern/cycles/render/tables.cpp
@@ -19,6 +19,7 @@
 #include "tables.h"
 
 #include "util_debug.h"
+#include "util_logging.h"
 
 CCL_NAMESPACE_BEGIN
 
@@ -36,6 +37,8 @@ LookupTables::~LookupTables()
 
 void LookupTables::device_update(Device *device, DeviceScene *dscene)
 {
+	VLOG(1) << "Total " << lookup_tables.size() << " lookup tables.";
+
 	if(!need_update)
 		return;




More information about the Bf-blender-cvs mailing list