[Bf-blender-cvs] [408a2a8] master: Compositor: Improve reports to the interface about what's going on

Sergey Sharybin noreply at git.blender.org
Fri Mar 27 10:39:20 CET 2015


Commit: 408a2a8420c9d918236194007c01e1d3b3ebe13c
Author: Sergey Sharybin
Date:   Fri Mar 27 14:38:02 2015 +0500
Branches: master
https://developer.blender.org/rB408a2a8420c9d918236194007c01e1d3b3ebe13c

Compositor: Improve reports to the interface about what's going on

The functionality was got lost when new compositor system was landed
and it wasn't always clear what's causing the hicucps. Now it's nicely
reported to the stats line.

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

M	source/blender/compositor/intern/COM_ExecutionGroup.cpp
M	source/blender/compositor/intern/COM_ExecutionGroup.h
M	source/blender/compositor/intern/COM_ExecutionSystem.cpp
M	source/blender/compositor/intern/COM_compositor.cpp

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

diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp
index 366c97b..a122d5d 100644
--- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp
+++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp
@@ -377,35 +377,6 @@ MemoryBuffer *ExecutionGroup::constructConsolidatedMemoryBuffer(MemoryProxy *mem
 	return result;
 }
 
-void ExecutionGroup::printBackgroundStats(void)
-{
-	uintptr_t mem_in_use, mmap_in_use, peak_memory;
-	float megs_used_memory, mmap_used_memory, megs_peak_memory;
-	double execution_time;
-	char timestr[64];
-
-	execution_time = PIL_check_seconds_timer() - this->m_executionStartTime;
-
-	mem_in_use = MEM_get_memory_in_use();
-	mmap_in_use = MEM_get_mapped_memory_in_use();
-	peak_memory = MEM_get_peak_memory();
-
-	megs_used_memory = (mem_in_use - mmap_in_use) / (1024.0 * 1024.0);
-	mmap_used_memory = (mmap_in_use) / (1024.0 * 1024.0);
-	megs_peak_memory = (peak_memory) / (1024.0 * 1024.0);
-
-	fprintf(stdout, "Mem:%.2fM (%.2fM, Peak %.2fM) ",
-	        megs_used_memory, mmap_used_memory, megs_peak_memory);
-
-	BLI_timestr(execution_time, timestr, sizeof(timestr));
-	printf("| Elapsed %s ", timestr);
-	printf("| Tree %s, Tile %u-%u ", this->m_bTree->id.name + 2,
-	       this->m_chunksFinished, this->m_numberOfChunks);
-
-	fputc('\n', stdout);
-	fflush(stdout);
-}
-
 void ExecutionGroup::finalizeChunkExecution(int chunkNumber, MemoryBuffer **memoryBuffers)
 {
 	if (this->m_chunkExecutionStates[chunkNumber] == COM_ES_SCHEDULED)
@@ -430,8 +401,11 @@ void ExecutionGroup::finalizeChunkExecution(int chunkNumber, MemoryBuffer **memo
 		progress /= this->m_numberOfChunks;
 		this->m_bTree->progress(this->m_bTree->prh, progress);
 
-		if (G.background)
-			printBackgroundStats();
+		char buf[128];
+		BLI_snprintf(buf, sizeof(buf), "Compositing | Tile %d-%d",
+		             this->m_chunksFinished,
+		             this->m_numberOfChunks);
+		this->m_bTree->stats_draw(this->m_bTree->sdh, buf);
 	}
 }
 
diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.h b/source/blender/compositor/intern/COM_ExecutionGroup.h
index 4b6f51c..99365cd 100644
--- a/source/blender/compositor/intern/COM_ExecutionGroup.h
+++ b/source/blender/compositor/intern/COM_ExecutionGroup.h
@@ -347,11 +347,6 @@ public:
 	MemoryBuffer *allocateOutputBuffer(int chunkNumber, rcti *rect);
 
 	/**
-	 * @brief print execution statistics to stdout when running in a background mode
-	 */
-	void printBackgroundStats(void);
-	
-	/**
 	 * @brief after a chunk is executed the needed resources can be freed or unlocked.
 	 * @param chunknumber
 	 * @param memorybuffers
diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp
index 0667271..1f8b765 100644
--- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp
+++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp
@@ -76,6 +76,8 @@ ExecutionSystem::ExecutionSystem(RenderData *rd, Scene *scene, bNodeTree *editin
 	                         viewer_border->xmin < viewer_border->xmax &&
 	                         viewer_border->ymin < viewer_border->ymax;
 
+	editingtree->stats_draw(editingtree->sdh, (char*)"Compositing | Determining resolution");
+
 	for (index = 0; index < this->m_groups.size(); index++) {
 		resolution[0] = 0;
 		resolution[1] = 0;
@@ -124,6 +126,9 @@ void ExecutionSystem::set_operations(const Operations &operations, const Groups
 
 void ExecutionSystem::execute()
 {
+	const bNodeTree *editingtree = this->m_context.getbNodeTree();
+	editingtree->stats_draw(editingtree->sdh, (char*)"Compositing | Initializing execution");
+
 	DebugInfo::execute_started(this);
 	
 	unsigned int order = 0;
@@ -178,6 +183,7 @@ void ExecutionSystem::execute()
 	WorkScheduler::finish();
 	WorkScheduler::stop();
 
+	editingtree->stats_draw(editingtree->sdh, (char*)"Compositing | Deinitializing execution");
 	for (index = 0; index < this->m_operations.size(); index++) {
 		NodeOperation *operation = this->m_operations[index];
 		operation->deinitExecution();
diff --git a/source/blender/compositor/intern/COM_compositor.cpp b/source/blender/compositor/intern/COM_compositor.cpp
index ec9ef6c..3348e7c 100644
--- a/source/blender/compositor/intern/COM_compositor.cpp
+++ b/source/blender/compositor/intern/COM_compositor.cpp
@@ -77,6 +77,7 @@ void COM_execute(RenderData *rd, Scene *scene, bNodeTree *editingtree, int rende
 
 	/* set progress bar to 0% and status to init compositing */
 	editingtree->progress(editingtree->prh, 0.0);
+	editingtree->stats_draw(editingtree->sdh, (char*)"Compositing");
 
 	bool twopass = (editingtree->flag & NTREE_TWO_PASS) > 0 && !rendering;
 	/* initialize execution system */




More information about the Bf-blender-cvs mailing list