|
Blender V4.5
|
#include <session.h>
Classes | |
| struct | DelayedReset |
Public Member Functions | |
| Session (const SessionParams ¶ms, const SceneParams &scene_params) | |
| ~Session () | |
| void | start () |
| void | cancel (bool quick=false) |
| void | draw () |
| void | wait () |
| bool | ready_to_reset () |
| void | reset (const SessionParams &session_params, const BufferParams &buffer_params) |
| void | set_pause (bool pause) |
| void | set_samples (const int samples) |
| void | set_time_limit (const double time_limit) |
| void | set_output_driver (unique_ptr< OutputDriver > driver) |
| void | set_display_driver (unique_ptr< DisplayDriver > driver) |
| double | get_estimated_remaining_time () const |
| void | device_free () |
| float | get_progress () |
| void | collect_statistics (RenderStats *stats) |
| void | process_full_buffer_from_disk (string_view filename) |
Public Attributes | |
| unique_ptr< Device > | device |
| unique_ptr< Device > | denoise_device_ |
| unique_ptr< Scene > | scene |
| Progress | progress |
| SessionParams | params |
| Stats | stats |
| Profiler | profiler |
| std::function< void(string_view)> | full_buffer_written_cb |
Protected Types | |
| enum | { SESSION_THREAD_WAIT , SESSION_THREAD_RENDER , SESSION_THREAD_END } |
Protected Member Functions | |
| void | thread_run () |
| void | thread_render () |
| bool | is_session_thread_rendering () |
| RenderWork | run_update_for_next_iteration () |
| bool | run_wait_for_work (const RenderWork &render_work) |
| void | run_main_render_loop () |
| bool | update_scene (const bool reset_samples) |
| void | update_status_time (bool show_pause=false, bool show_done=false) |
| bool | delayed_reset_buffer_params () |
| void | update_buffers_for_params () |
| int2 | get_effective_tile_size () const |
| Device * | denoise_device () |
Protected Attributes | |
| struct Session::DelayedReset | delayed_reset_ |
| unique_ptr< thread > | session_thread_ = nullptr |
| thread_condition_variable | session_thread_cond_ |
| thread_mutex | session_thread_mutex_ |
| enum Session:: { ... } | session_thread_state_ = SESSION_THREAD_WAIT |
| bool | pause_ = false |
| bool | new_work_added_ = false |
| thread_condition_variable | pause_cond_ |
| thread_mutex | pause_mutex_ |
| thread_mutex | tile_mutex_ |
| thread_mutex | buffers_mutex_ |
| TileManager | tile_manager_ |
| BufferParams | buffer_params_ |
| RenderScheduler | render_scheduler_ |
| unique_ptr< PathTrace > | path_trace_ |
Definition at line 112 of file session/session.h.
|
protected |
| Enumerator | |
|---|---|
| SESSION_THREAD_WAIT | |
| SESSION_THREAD_RENDER | |
| SESSION_THREAD_END | |
Definition at line 228 of file session/session.h.
|
explicit |
Definition at line 30 of file session/session.cpp.
References Device::create(), delayed_reset_, denoise_device(), SessionParams::denoise_device, denoise_device_, device, SessionParams::device, Session::DelayedReset::do_reset, full_buffer_written_cb, TileManager::full_buffer_written_cb, SessionParams::headless, TaskScheduler::init(), new_work_added_, params, path_trace_, pause_, profiler, progress, render_scheduler_, scene, session_thread_, Progress::set_error(), stats, thread_run(), SessionParams::threads, tile_manager_, and update_status_time().
| Session::~Session | ( | ) |
Definition at line 80 of file session/session.cpp.
References cancel(), denoise_device_, device, TaskScheduler::exit(), path_trace_, scene, session_thread_, session_thread_cond_, SESSION_THREAD_END, session_thread_mutex_, and session_thread_state_.
| void Session::cancel | ( | bool | quick = false | ) |
Definition at line 126 of file session/session.cpp.
References device, is_session_thread_rendering(), path_trace_, pause_, pause_cond_, pause_mutex_, progress, Progress::set_cancel(), and wait().
Referenced by HdCyclesRenderPass::~HdCyclesRenderPass(), and ~Session().
| void Session::collect_statistics | ( | RenderStats * | stats | ) |
Definition at line 765 of file session/session.cpp.
References RenderStats::collect_profiling(), SessionParams::device, DEVICE_CPU, params, profiler, scene, DeviceInfo::type, and SessionParams::use_profiling.
|
protected |
Definition at line 497 of file session/session.cpp.
References Session::DelayedReset::buffer_params, buffer_params_, buffers_mutex_, delayed_reset_, Session::DelayedReset::do_reset, BufferParams::exposure, get_effective_tile_size(), Integrator::MAX_SAMPLES, min, Session::DelayedReset::mutex, params, TileManager::reset_scheduling(), BufferParams::samples, SessionParams::samples, scene, Session::DelayedReset::session_params, tile_manager_, BufferParams::use_approximate_shadow_catcher, and BufferParams::use_transparent_background.
Referenced by run_update_for_next_iteration().
|
inlineprotected |
Definition at line 217 of file session/session.h.
References denoise_device_, and device.
Referenced by Session().
| void Session::device_free | ( | ) |
Definition at line 759 of file session/session.cpp.
References path_trace_, and scene.
| void Session::draw | ( | ) |
Definition at line 466 of file session/session.cpp.
References path_trace_.
|
protected |
Definition at line 471 of file session/session.cpp.
References buffer_params_, TileManager::compute_render_tile_size(), BufferParams::height, image_height, image_width, make_int2(), TileManager::MAX_TILE_SIZE, params, tile_manager_, SessionParams::tile_size, SessionParams::use_auto_tile, and BufferParams::width.
Referenced by delayed_reset_buffer_params().
| double Session::get_estimated_remaining_time | ( | ) | const |
Definition at line 640 of file session/session.cpp.
References TileManager::get_num_tiles(), Progress::get_progress(), Progress::get_time(), RenderScheduler::get_time_limit(), max, min, progress, render_scheduler_, tile_manager_, and total_time.
| float Session::get_progress | ( | ) |
|
protected |
Definition at line 296 of file session/session.cpp.
References session_thread_mutex_, SESSION_THREAD_RENDER, and session_thread_state_.
Referenced by cancel(), and set_pause().
| void Session::process_full_buffer_from_disk | ( | string_view | filename | ) |
Definition at line 777 of file session/session.cpp.
References path_trace_.
| bool Session::ready_to_reset | ( | ) |
Definition at line 155 of file session/session.cpp.
References path_trace_.
| void Session::reset | ( | const SessionParams & | session_params, |
| const BufferParams & | buffer_params ) |
Definition at line 557 of file session/session.cpp.
References Session::DelayedReset::buffer_params, delayed_reset_, Session::DelayedReset::do_reset, Session::DelayedReset::mutex, path_trace_, pause_cond_, pause_mutex_, scene, and Session::DelayedReset::session_params.
|
protected |
Definition at line 160 of file session/session.cpp.
References SessionParams::background, buffers_mutex_, device, Progress::get_cancel(), Progress::get_time(), params, path_trace_, progress, render_scheduler_, RenderScheduler::render_work_reschedule_on_cancel(), run_update_for_next_iteration(), run_wait_for_work(), Progress::set_error(), Progress::set_status(), Progress::set_update(), total_time, update_status_time(), VLOG_INFO, and VLOG_INFO_IS_ON.
Referenced by thread_render().
|
protected |
Definition at line 302 of file session/session.cpp.
References Progress::add_finished_tile(), Progress::add_skip_time(), SessionParams::background, buffer_params_, delayed_reset_, delayed_reset_buffer_params(), device, Session::DelayedReset::do_reset, BufferParams::full_height, BufferParams::full_width, BufferParams::full_x, BufferParams::full_y, Progress::get_cancel(), TileManager::get_current_tile(), RenderScheduler::get_render_work(), BufferParams::height, max, TileManager::next(), params, path_trace_, progress, render_scheduler_, RenderScheduler::reset_for_next_tile(), RenderWork::resolution_divider, SessionParams::sample_subset_length, SessionParams::sample_subset_offset, SessionParams::samples, scene, RenderScheduler::set_sample_params(), Progress::set_status(), RenderScheduler::set_time_limit(), tile, tile_manager_, SessionParams::time_limit, update_buffers_for_params(), BufferParams::update_offset_stride(), update_scene(), GuidingParams::use, SessionParams::use_sample_subset, BufferParams::width, BufferParams::window_height, BufferParams::window_width, BufferParams::window_x, BufferParams::window_y, KernelWorkTile::x, and KernelWorkTile::y.
Referenced by run_main_render_loop().
|
protected |
Definition at line 424 of file session/session.cpp.
References Progress::add_skip_time(), SessionParams::background, delayed_reset_, Session::DelayedReset::do_reset, Progress::get_cancel(), new_work_added_, params, pause_, pause_cond_, pause_mutex_, progress, Progress::set_update(), and update_status_time().
Referenced by run_main_render_loop().
| void Session::set_display_driver | ( | unique_ptr< DisplayDriver > | driver | ) |
Definition at line 635 of file session/session.cpp.
References path_trace_.
Referenced by HdCyclesRenderPass::HdCyclesRenderPass().
| void Session::set_output_driver | ( | unique_ptr< OutputDriver > | driver | ) |
Definition at line 630 of file session/session.cpp.
References path_trace_.
Referenced by HdCyclesRenderPass::HdCyclesRenderPass().
| void Session::set_pause | ( | bool | pause | ) |
Definition at line 607 of file session/session.cpp.
References is_session_thread_rendering(), pause_, pause_cond_, pause_mutex_, and update_status_time().
| void Session::set_samples | ( | const int | samples | ) |
Definition at line 575 of file session/session.cpp.
References new_work_added_, params, pause_cond_, pause_mutex_, samples, and SessionParams::samples.
Referenced by HdCyclesDelegate::SetRenderSetting().
| void Session::set_time_limit | ( | const double | time_limit | ) |
Definition at line 591 of file session/session.cpp.
References new_work_added_, params, pause_cond_, pause_mutex_, and SessionParams::time_limit.
Referenced by HdCyclesDelegate::SetRenderSetting().
| void Session::start | ( | ) |
Definition at line 111 of file session/session.cpp.
References session_thread_cond_, session_thread_mutex_, SESSION_THREAD_RENDER, and session_thread_state_.
|
protected |
Definition at line 268 of file session/session.cpp.
References SessionParams::device, DEVICE_CPU, Progress::get_cancel(), Progress::get_cancel_message(), params, profiler, progress, Progress::reset_sample(), run_main_render_loop(), Progress::set_status(), Progress::set_update(), Profiler::start(), Profiler::stop(), DeviceInfo::type, and SessionParams::use_profiling.
Referenced by thread_run().
|
protected |
Definition at line 231 of file session/session.cpp.
References path_trace_, session_thread_cond_, SESSION_THREAD_END, session_thread_mutex_, SESSION_THREAD_RENDER, session_thread_state_, SESSION_THREAD_WAIT, and thread_render().
Referenced by Session().
|
protected |
Definition at line 526 of file session/session.cpp.
References SessionParams::background, buffer_params_, TileManager::get_num_tiles(), BufferParams::height, params, progress, render_scheduler_, RenderScheduler::reset(), Progress::reset_sample(), SessionParams::sample_subset_length, SessionParams::sample_subset_offset, BufferParams::samples, SessionParams::samples, scene, Progress::set_render_start_time(), RenderScheduler::set_sample_params(), Progress::set_start_time(), TileManager::set_temp_dir(), Progress::set_time_limit(), Progress::set_total_pixel_samples(), SessionParams::temp_dir, tile_manager_, SessionParams::time_limit, TileManager::update(), BufferParams::update_passes(), SessionParams::use_sample_subset, and BufferParams::width.
Referenced by run_update_for_next_iteration().
|
protected |
Definition at line 673 of file session/session.cpp.
References TileManager::has_multiple_tiles(), params, profiler, progress, Profiler::reset(), reset(), SessionParams::sample_subset_length, SessionParams::sample_subset_offset, SessionParams::samples, scene, tile_manager_, and SessionParams::use_sample_subset.
Referenced by run_update_for_next_iteration().
Definition at line 710 of file session/session.cpp.
References SessionParams::background, device, Progress::get_current_sample(), RenderScheduler::get_num_samples(), TileManager::get_num_tiles(), Progress::get_rendered_tiles(), TileManager::has_multiple_tiles(), Integrator::MAX_SAMPLES, num_tiles, params, progress, render_scheduler_, Progress::set_end_time(), Progress::set_status(), status_append(), string_printf(), and tile_manager_.
Referenced by run_main_render_loop(), run_wait_for_work(), Session(), and set_pause().
| void Session::wait | ( | ) |
Definition at line 661 of file session/session.cpp.
References session_thread_cond_, session_thread_mutex_, SESSION_THREAD_RENDER, and session_thread_state_.
Referenced by cancel().
|
protected |
Definition at line 243 of file session/session.h.
Referenced by delayed_reset_buffer_params(), get_effective_tile_size(), run_update_for_next_iteration(), and update_buffers_for_params().
|
protected |
Definition at line 240 of file session/session.h.
Referenced by delayed_reset_buffer_params(), and run_main_render_loop().
|
protected |
Referenced by delayed_reset_buffer_params(), reset(), run_update_for_next_iteration(), run_wait_for_work(), and Session().
| unique_ptr<Device> Session::denoise_device_ |
Definition at line 116 of file session/session.h.
Referenced by denoise_device(), Session(), and ~Session().
| unique_ptr<Device> Session::device |
Definition at line 114 of file session/session.h.
Referenced by cancel(), denoise_device(), run_main_render_loop(), run_update_for_next_iteration(), Session(), update_status_time(), and ~Session().
| std::function<void(string_view)> Session::full_buffer_written_cb |
Definition at line 126 of file session/session.h.
Referenced by Session().
|
protected |
Definition at line 235 of file session/session.h.
Referenced by run_wait_for_work(), Session(), set_samples(), and set_time_limit().
| SessionParams Session::params |
Definition at line 119 of file session/session.h.
Referenced by collect_statistics(), delayed_reset_buffer_params(), get_effective_tile_size(), HdCyclesDelegate::GetRenderSetting(), run_main_render_loop(), run_update_for_next_iteration(), run_wait_for_work(), Session(), set_samples(), set_time_limit(), HdCyclesDelegate::SetRenderSetting(), thread_render(), update_buffers_for_params(), update_scene(), and update_status_time().
|
protected |
Definition at line 252 of file session/session.h.
Referenced by cancel(), device_free(), draw(), process_full_buffer_from_disk(), ready_to_reset(), reset(), run_main_render_loop(), run_update_for_next_iteration(), Session(), set_display_driver(), set_output_driver(), thread_run(), and ~Session().
|
protected |
Definition at line 234 of file session/session.h.
Referenced by cancel(), run_wait_for_work(), Session(), and set_pause().
|
protected |
Definition at line 237 of file session/session.h.
Referenced by cancel(), reset(), run_wait_for_work(), set_pause(), set_samples(), and set_time_limit().
|
protected |
Definition at line 238 of file session/session.h.
Referenced by cancel(), reset(), run_wait_for_work(), set_pause(), set_samples(), and set_time_limit().
| Profiler Session::profiler |
Definition at line 121 of file session/session.h.
Referenced by collect_statistics(), Session(), thread_render(), and update_scene().
| Progress Session::progress |
Definition at line 118 of file session/session.h.
Referenced by cancel(), get_estimated_remaining_time(), HdCyclesRenderPass::HdCyclesRenderPass(), run_main_render_loop(), run_update_for_next_iteration(), run_wait_for_work(), Session(), thread_render(), update_buffers_for_params(), update_scene(), and update_status_time().
|
protected |
Definition at line 246 of file session/session.h.
Referenced by get_estimated_remaining_time(), run_main_render_loop(), run_update_for_next_iteration(), Session(), update_buffers_for_params(), and update_status_time().
| unique_ptr<Scene> Session::scene |
Definition at line 117 of file session/session.h.
Referenced by collect_statistics(), delayed_reset_buffer_params(), device_free(), HdCyclesFileReader::read(), reset(), run_update_for_next_iteration(), Session(), update_buffers_for_params(), update_scene(), and ~Session().
Definition at line 225 of file session/session.h.
Referenced by Session(), and ~Session().
|
protected |
Definition at line 226 of file session/session.h.
Referenced by start(), thread_run(), wait(), and ~Session().
|
protected |
Definition at line 227 of file session/session.h.
Referenced by is_session_thread_rendering(), start(), thread_run(), wait(), and ~Session().
| enum { ... } Session::session_thread_state_ |
Referenced by is_session_thread_rendering(), start(), thread_run(), wait(), and ~Session().
| Stats Session::stats |
Definition at line 120 of file session/session.h.
Referenced by Session().
|
protected |
Definition at line 242 of file session/session.h.
Referenced by delayed_reset_buffer_params(), get_effective_tile_size(), get_estimated_remaining_time(), run_update_for_next_iteration(), Session(), update_buffers_for_params(), update_scene(), and update_status_time().
|
protected |
Definition at line 239 of file session/session.h.