diff options
author | Colin Basnett <cmbasnett@gmail.com> | 2022-09-17 03:50:37 +0300 |
---|---|---|
committer | Colin Basnett <cmbasnett@gmail.com> | 2022-09-17 03:50:37 +0300 |
commit | 564bda241a973396da51d7c3ccd9efd97d51728a (patch) | |
tree | 4d9aa4cccd82e2e606b47774afa5e1015bf14768 /intern/cycles/session/session.cpp | |
parent | 0fff238150d076576053c25b646f653d6e3b0edb (diff) | |
parent | 48d7ff68f0df209c77bbb081ab46fbc109fd825a (diff) |
Merge branch 'master' into feature-imformatfeature-imformat
Diffstat (limited to 'intern/cycles/session/session.cpp')
-rw-r--r-- | intern/cycles/session/session.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/intern/cycles/session/session.cpp b/intern/cycles/session/session.cpp index ba30be817cf..a2955da5480 100644 --- a/intern/cycles/session/session.cpp +++ b/intern/cycles/session/session.cpp @@ -146,11 +146,11 @@ void Session::run_main_render_loop() RenderWork render_work = run_update_for_next_iteration(); if (!render_work) { - if (VLOG_WORK_IS_ON) { + if (VLOG_INFO_IS_ON) { double total_time, render_time; progress.get_time(total_time, render_time); - VLOG_WORK << "Rendering in main loop is done in " << render_time << " seconds."; - VLOG_WORK << path_trace_->full_report(); + VLOG_INFO << "Rendering in main loop is done in " << render_time << " seconds."; + VLOG_INFO << path_trace_->full_report(); } if (params.background) { @@ -370,6 +370,14 @@ RenderWork Session::run_update_for_next_iteration() if (update_scene(width, height)) { profiler.reset(scene->shaders.size(), scene->objects.size()); } + + /* Unlock scene mutex before loading denoiser kernels, since that may attempt to activate + * graphics interop, which can deadlock when the scene mutex is still being held. */ + scene_lock.unlock(); + + path_trace_->load_kernels(); + path_trace_->alloc_work_memory(); + progress.add_skip_time(update_timer, params.background); } @@ -428,8 +436,7 @@ int2 Session::get_effective_tile_size() const const int image_width = buffer_params_.width; const int image_height = buffer_params_.height; - /* No support yet for baking with tiles. */ - if (!params.use_auto_tile || scene->bake_manager->get_baking()) { + if (!params.use_auto_tile) { return make_int2(image_width, image_height); } @@ -495,7 +502,9 @@ void Session::do_delayed_reset() if (!params.background) { progress.set_start_time(); } + const double time_limit = params.time_limit * ((double)tile_manager_.get_num_tiles()); progress.set_render_start_time(); + progress.set_time_limit(time_limit); } void Session::reset(const SessionParams &session_params, const BufferParams &buffer_params) @@ -590,7 +599,8 @@ double Session::get_estimated_remaining_time() const progress.get_time(total_time, render_time); double remaining = (1.0 - (double)completed) * (render_time / (double)completed); - const double time_limit = render_scheduler_.get_time_limit(); + const double time_limit = render_scheduler_.get_time_limit() * + ((double)tile_manager_.get_num_tiles()); if (time_limit != 0.0) { remaining = min(remaining, max(time_limit - render_time, 0.0)); } @@ -618,12 +628,7 @@ bool Session::update_scene(int width, int height) Camera *cam = scene->camera; cam->set_screen_size(width, height); - const bool scene_update_result = scene->update(progress); - - path_trace_->load_kernels(); - path_trace_->alloc_work_memory(); - - return scene_update_result; + return scene->update(progress); } static string status_append(const string &status, const string &suffix) |