diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-08-05 20:49:12 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-08-05 20:49:12 +0300 |
commit | fafd1ab9d3a6ea59734288cacb40607230be826a (patch) | |
tree | d49db404b57a425c6976e6c24124c134bc1327a8 /source | |
parent | 91250022d003ec8909e1a602445a637d51124dc0 (diff) | |
parent | 4181d82ad1e3cbe9f3774e6c60767e1915201548 (diff) |
Merge branch 'blender-v3.3-release'
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/render/intern/pipeline.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/render/intern/pipeline.c b/source/blender/render/intern/pipeline.c index 1c42467bc3d..30e8cfa5c17 100644 --- a/source/blender/render/intern/pipeline.c +++ b/source/blender/render/intern/pipeline.c @@ -199,14 +199,20 @@ static void stats_background(void *UNUSED(arg), RenderStats *rs) megs_used_memory = (mem_in_use) / (1024.0 * 1024.0); megs_peak_memory = (peak_memory) / (1024.0 * 1024.0); + BLI_timecode_string_from_time_simple( + info_time_str, sizeof(info_time_str), PIL_check_seconds_timer() - rs->starttime); + + /* Compositor calls this from multiple threads, mutex lock to ensure we don't + * get garbled output. */ + static ThreadMutex mutex = BLI_MUTEX_INITIALIZER; + BLI_mutex_lock(&mutex); + fprintf(stdout, TIP_("Fra:%d Mem:%.2fM (Peak %.2fM) "), rs->cfra, megs_used_memory, megs_peak_memory); - BLI_timecode_string_from_time_simple( - info_time_str, sizeof(info_time_str), PIL_check_seconds_timer() - rs->starttime); fprintf(stdout, TIP_("| Time:%s | "), info_time_str); fprintf(stdout, "%s", rs->infostr); @@ -220,6 +226,8 @@ static void stats_background(void *UNUSED(arg), RenderStats *rs) fputc('\n', stdout); fflush(stdout); + + BLI_mutex_unlock(&mutex); } void RE_FreeRenderResult(RenderResult *rr) |