Blender
V3.3
|
#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 (int samples) |
void | set_time_limit (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 | |
Device * | device |
Scene * | scene |
Progress | progress |
SessionParams | params |
Stats | stats |
Profiler | profiler |
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 (int width, int height) |
void | update_status_time (bool show_pause=false, bool show_done=false) |
void | do_delayed_reset () |
int2 | get_effective_tile_size () const |
Protected Attributes | |
struct Session::DelayedReset | delayed_reset_ |
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 103 of file session/session.h.
|
protected |
Enumerator | |
---|---|
SESSION_THREAD_WAIT | |
SESSION_THREAD_RENDER | |
SESSION_THREAD_END |
Definition at line 210 of file session/session.h.
|
explicit |
Definition at line 34 of file session/session.cpp.
References Device::create(), delayed_reset_, SessionParams::device, device, Session::DelayedReset::do_reset, Scene::dscene, Device::error_message(), Scene::film, full_buffer_written_cb, TileManager::full_buffer_written_cb, function_bind, Device::have_error(), 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 69 of file session/session.cpp.
References cancel(), device, TaskScheduler::exit(), thread::join(), path_trace_, scene, session_thread_, session_thread_cond_, SESSION_THREAD_END, session_thread_mutex_, and session_thread_state_.
Definition at line 114 of file session/session.cpp.
References is_session_thread_rendering(), path_trace_, pause_, pause_cond_, pause_mutex_, progress, Progress::set_cancel(), and wait().
Referenced by BlenderSession::bake(), BlenderSession::free_session(), HdCyclesRenderPass::~HdCyclesRenderPass(), and ~Session().
void Session::collect_statistics | ( | RenderStats * | stats | ) |
Definition at line 692 of file session/session.cpp.
References RenderStats::collect_profiling(), Scene::collect_statistics(), SessionParams::device, DEVICE_CPU, params, profiler, scene, DeviceInfo::type, and SessionParams::use_profiling.
Referenced by BlenderSession::render().
void Session::device_free | ( | ) |
Definition at line 686 of file session/session.cpp.
References Scene::device_free(), path_trace_, and scene.
Referenced by BlenderSession::render_frame_finish().
|
protected |
Definition at line 463 of file session/session.cpp.
References Scene::background, SessionParams::background, Session::DelayedReset::buffer_params, buffer_params_, delayed_reset_, Session::DelayedReset::do_reset, BufferParams::exposure, Scene::film, get_effective_tile_size(), TileManager::has_multiple_tiles(), BufferParams::height, params, Scene::passes, progress, render_scheduler_, RenderScheduler::reset(), Progress::reset_sample(), TileManager::reset_scheduling(), SessionParams::sample_offset, BufferParams::samples, SessionParams::samples, scene, Session::DelayedReset::session_params, Progress::set_render_start_time(), Progress::set_start_time(), TileManager::set_temp_dir(), Progress::set_total_pixel_samples(), SessionParams::temp_dir, tile_manager_, TileManager::update(), BufferParams::update_passes(), Film::update_passes(), BufferParams::use_approximate_shadow_catcher, BufferParams::use_transparent_background, and BufferParams::width.
Referenced by run_update_for_next_iteration().
void Session::draw | ( | ) |
Definition at line 433 of file session/session.cpp.
References path_trace_.
Referenced by BlenderSession::draw(), and BlenderSession::view_draw().
|
protected |
Definition at line 438 of file session/session.cpp.
References buffer_params_, TileManager::compute_render_tile_size(), BufferParams::height, make_int2, TileManager::MAX_TILE_SIZE, params, tile_manager_, SessionParams::tile_size, SessionParams::use_auto_tile, and BufferParams::width.
Referenced by do_delayed_reset().
double Session::get_estimated_remaining_time | ( | ) | const |
Definition at line 593 of file session/session.cpp.
References double(), Progress::get_progress(), Progress::get_time(), RenderScheduler::get_time_limit(), max, min, progress, and render_scheduler_.
Referenced by BlenderSession::update_status_progress().
float Session::get_progress | ( | ) |
|
protected |
Definition at line 278 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 704 of file session/session.cpp.
References path_trace_.
Referenced by BlenderSession::render_frame_finish().
bool Session::ready_to_reset | ( | ) |
Definition at line 140 of file session/session.cpp.
References path_trace_.
Referenced by BlenderSession::synchronize(), and BlenderSession::view_draw().
void Session::reset | ( | const SessionParams & | session_params, |
const BufferParams & | buffer_params | ||
) |
Definition at line 512 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_, and Session::DelayedReset::session_params.
Referenced by BlenderSession::bake(), BlenderSession::create_session(), BlenderSession::render(), BlenderSession::reset_session(), session_init(), BlenderSession::synchronize(), and BlenderSession::view_draw().
|
protected |
Definition at line 145 of file session/session.cpp.
References SessionParams::background, buffers_mutex_, device, Device::error_message(), Progress::get_cancel(), Progress::get_time(), Device::have_error(), 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(), update_status_time(), VLOG_INFO, and VLOG_INFO_IS_ON.
Referenced by thread_render().
|
protected |
Definition at line 284 of file session/session.cpp.
References Progress::add_finished_tile(), Progress::add_skip_time(), SessionParams::background, buffer_params_, buffers_mutex_, delayed_reset_, do_delayed_reset(), Session::DelayedReset::do_reset, BufferParams::full_height, BufferParams::full_width, BufferParams::full_x, BufferParams::full_y, Integrator::get_adaptive_sampling(), TileManager::get_current_tile(), Integrator::get_denoise_params(), RenderScheduler::get_render_work(), BufferParams::height, height, Scene::integrator, max, Scene::mutex, Session::DelayedReset::mutex, TileManager::next(), Scene::objects, params, path_trace_, profiler, progress, render_scheduler_, Profiler::reset(), RenderScheduler::reset_for_next_tile(), RenderWork::resolution_divider, SessionParams::sample_offset, SessionParams::samples, scene, RenderScheduler::set_num_samples(), RenderScheduler::set_start_sample(), RenderScheduler::set_time_limit(), Scene::shaders, tile, tile_manager_, SessionParams::time_limit, BufferParams::update_offset_stride(), update_scene(), BufferParams::width, 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 391 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 588 of file session/session.cpp.
References path_trace_.
Referenced by BlenderSession::bake(), BlenderSession::ensure_display_driver_if_needed(), HdCyclesRenderPass::HdCyclesRenderPass(), BlenderSession::render_frame_finish(), and session_init().
void Session::set_output_driver | ( | unique_ptr< OutputDriver > | driver | ) |
Definition at line 583 of file session/session.cpp.
References path_trace_.
Referenced by BlenderSession::bake(), HdCyclesRenderPass::HdCyclesRenderPass(), BlenderSession::render(), BlenderSession::render_frame_finish(), and session_init().
Definition at line 560 of file session/session.cpp.
References is_session_thread_rendering(), pause_, pause_cond_, pause_mutex_, and update_status_time().
Referenced by BlenderSession::create_session(), BlenderSession::synchronize(), and BlenderSession::view_draw().
void Session::set_samples | ( | int | samples | ) |
Definition at line 528 of file session/session.cpp.
References new_work_added_, params, pause_cond_, pause_mutex_, and SessionParams::samples.
Referenced by HdCyclesDelegate::SetRenderSetting(), and BlenderSession::synchronize().
Definition at line 544 of file session/session.cpp.
References new_work_added_, params, pause_cond_, pause_mutex_, and SessionParams::time_limit.
Referenced by HdCyclesDelegate::SetRenderSetting(), and BlenderSession::synchronize().
void Session::start | ( | ) |
Definition at line 99 of file session/session.cpp.
References session_thread_cond_, session_thread_mutex_, SESSION_THREAD_RENDER, and session_thread_state_.
Referenced by BlenderSession::bake(), BlenderSession::render(), session_init(), and BlenderSession::synchronize().
|
protected |
Definition at line 252 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 215 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 624 of file session/session.cpp.
References Scene::camera, height, progress, scene, Camera::set_screen_size(), Scene::update(), and width.
Referenced by run_update_for_next_iteration().
Definition at line 644 of file session/session.cpp.
References SessionParams::background, Progress::get_current_sample(), RenderScheduler::get_num_samples(), TileManager::get_num_tiles(), Progress::get_rendered_tiles(), TileManager::has_multiple_tiles(), Integrator::MAX_SAMPLES, num_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 612 of file session/session.cpp.
References session_thread_cond_, session_thread_mutex_, SESSION_THREAD_RENDER, and session_thread_state_.
Referenced by BlenderSession::bake(), cancel(), main(), and BlenderSession::render().
|
protected |
Definition at line 225 of file session/session.h.
Referenced by do_delayed_reset(), get_effective_tile_size(), and run_update_for_next_iteration().
|
protected |
Definition at line 222 of file session/session.h.
Referenced by run_main_render_loop(), and run_update_for_next_iteration().
|
protected |
Referenced by do_delayed_reset(), reset(), run_update_for_next_iteration(), run_wait_for_work(), and Session().
Device* Session::device |
Definition at line 105 of file session/session.h.
Referenced by BlenderSession::builtin_images_load(), run_main_render_loop(), Session(), and ~Session().
function<void(string_view)> Session::full_buffer_written_cb |
Definition at line 115 of file session/session.h.
Referenced by BlenderSession::bake(), BlenderSession::render(), BlenderSession::render_frame_finish(), and Session().
|
protected |
Definition at line 217 of file session/session.h.
Referenced by run_wait_for_work(), Session(), set_samples(), and set_time_limit().
SessionParams Session::params |
Definition at line 108 of file session/session.h.
Referenced by collect_statistics(), do_delayed_reset(), get_effective_tile_size(), HdCyclesDelegate::GetRenderSetting(), BlenderSession::reset_session(), run_main_render_loop(), run_update_for_next_iteration(), run_wait_for_work(), Session(), set_samples(), set_time_limit(), HdCyclesDelegate::SetRenderSetting(), BlenderSession::stamp_view_layer_metadata(), BlenderSession::synchronize(), thread_render(), and update_status_time().
|
protected |
Definition at line 234 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 216 of file session/session.h.
Referenced by cancel(), run_wait_for_work(), Session(), and set_pause().
|
protected |
Definition at line 219 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 220 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 110 of file session/session.h.
Referenced by collect_statistics(), run_update_for_next_iteration(), Session(), and thread_render().
Progress Session::progress |
Definition at line 107 of file session/session.h.
Referenced by BlenderSession::bake(), BlenderSession::builtin_images_load(), cancel(), BlenderSession::check_and_report_session_error(), BlenderSession::create_session(), do_delayed_reset(), get_estimated_remaining_time(), BlenderSession::get_progress(), BlenderSession::get_status(), HdCyclesRenderPass::HdCyclesRenderPass(), BlenderSession::render(), BlenderSession::reset_session(), run_main_render_loop(), run_update_for_next_iteration(), run_wait_for_work(), Session(), session_init(), session_print_status(), BlenderSession::stamp_view_layer_metadata(), BlenderSession::test_cancel(), thread_render(), BlenderSession::update_bake_progress(), update_scene(), and update_status_time().
|
protected |
Definition at line 228 of file session/session.h.
Referenced by do_delayed_reset(), get_estimated_remaining_time(), run_main_render_loop(), run_update_for_next_iteration(), Session(), and update_status_time().
Scene* Session::scene |
Definition at line 106 of file session/session.h.
Referenced by BlenderSession::builtin_images_load(), collect_statistics(), BlenderSession::create_session(), device_free(), do_delayed_reset(), BlenderSession::draw(), HdCyclesFileReader::read(), run_update_for_next_iteration(), scene_init(), Session(), BlenderSession::synchronize(), update_scene(), BlenderSession::view_draw(), and ~Session().
|
protected |
Definition at line 207 of file session/session.h.
Referenced by Session(), and ~Session().
|
protected |
Definition at line 208 of file session/session.h.
Referenced by start(), thread_run(), wait(), and ~Session().
|
protected |
Definition at line 209 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 109 of file session/session.h.
Referenced by BlenderSession::reset_session(), Session(), and BlenderSession::update_status_progress().
|
protected |
Definition at line 224 of file session/session.h.
Referenced by do_delayed_reset(), get_effective_tile_size(), run_update_for_next_iteration(), Session(), and update_status_time().
|
protected |
Definition at line 221 of file session/session.h.