From 408a2a8420c9d918236194007c01e1d3b3ebe13c Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 27 Mar 2015 14:38:02 +0500 Subject: 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. --- .../compositor/intern/COM_ExecutionGroup.cpp | 36 +++------------------- .../blender/compositor/intern/COM_ExecutionGroup.h | 5 --- .../compositor/intern/COM_ExecutionSystem.cpp | 6 ++++ .../blender/compositor/intern/COM_compositor.cpp | 1 + 4 files changed, 12 insertions(+), 36 deletions(-) (limited to 'source/blender/compositor/intern') diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp index 366c97b50c6..a122d5d9988 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 4b6f51c72c0..99365cdd4a8 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.h +++ b/source/blender/compositor/intern/COM_ExecutionGroup.h @@ -346,11 +346,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 diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp index 0667271f4b1..1f8b7654786 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 ec9ef6c7e68..3348e7c73d8 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 */ -- cgit v1.2.3