Blender V5.0
Session Class Reference

#include <session.h>

Classes

struct  DelayedReset

Public Member Functions

 Session (const SessionParams &params, 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< Devicedevice
unique_ptr< Devicedenoise_device_
unique_ptr< Scenescene
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
Devicedenoise_device ()

Protected Attributes

struct Session::DelayedReset delayed_reset_
unique_ptr< threadsession_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< PathTracepath_trace_

Detailed Description

Definition at line 110 of file session/session.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
SESSION_THREAD_WAIT 
SESSION_THREAD_RENDER 
SESSION_THREAD_END 

Definition at line 226 of file session/session.h.

Constructor & Destructor Documentation

◆ Session()

◆ ~Session()

Member Function Documentation

◆ cancel()

void Session::cancel ( bool quick = false)

◆ collect_statistics()

void Session::collect_statistics ( RenderStats * stats)

Definition at line 765 of file session/session.cpp.

References RenderStats::collect_profiling(), DEVICE_CPU, params, profiler, and scene.

◆ delayed_reset_buffer_params()

bool Session::delayed_reset_buffer_params ( )
protected

◆ denoise_device()

Device * Session::denoise_device ( )
inlineprotected

Definition at line 215 of file session/session.h.

References denoise_device_, and device.

Referenced by Session().

◆ device_free()

void Session::device_free ( )

Definition at line 759 of file session/session.cpp.

References path_trace_, and scene.

◆ draw()

void Session::draw ( )

Definition at line 466 of file session/session.cpp.

References path_trace_.

◆ get_effective_tile_size()

int2 Session::get_effective_tile_size ( ) const
protected

◆ get_estimated_remaining_time()

double Session::get_estimated_remaining_time ( ) const

Definition at line 640 of file session/session.cpp.

References max, min, progress, render_scheduler_, tile_manager_, and total_time.

◆ get_progress()

float Session::get_progress ( )

References stats.

◆ is_session_thread_rendering()

bool Session::is_session_thread_rendering ( )
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().

◆ process_full_buffer_from_disk()

void Session::process_full_buffer_from_disk ( string_view filename)

Definition at line 777 of file session/session.cpp.

References path_trace_.

◆ ready_to_reset()

bool Session::ready_to_reset ( )

Definition at line 155 of file session/session.cpp.

References path_trace_.

◆ reset()

void Session::reset ( const SessionParams & session_params,
const BufferParams & buffer_params )

Definition at line 557 of file session/session.cpp.

References delayed_reset_, path_trace_, pause_cond_, pause_mutex_, and scene.

Referenced by update_scene().

◆ run_main_render_loop()

◆ run_update_for_next_iteration()

◆ run_wait_for_work()

bool Session::run_wait_for_work ( const RenderWork & render_work)
protected

◆ set_display_driver()

void Session::set_display_driver ( unique_ptr< DisplayDriver > driver)

Definition at line 635 of file session/session.cpp.

References path_trace_.

◆ set_output_driver()

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().

◆ set_pause()

void Session::set_pause ( bool pause)

◆ set_samples()

void Session::set_samples ( const int samples)

Definition at line 575 of file session/session.cpp.

References new_work_added_, params, pause_cond_, and pause_mutex_.

Referenced by HdCyclesDelegate::SetRenderSetting().

◆ set_time_limit()

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_, and pause_mutex_.

Referenced by HdCyclesDelegate::SetRenderSetting().

◆ start()

void Session::start ( )

◆ thread_render()

void Session::thread_render ( )
protected

Definition at line 268 of file session/session.cpp.

References DEVICE_CPU, params, profiler, progress, and run_main_render_loop().

Referenced by thread_run().

◆ thread_run()

◆ update_buffers_for_params()

void Session::update_buffers_for_params ( )
protected

◆ update_scene()

bool Session::update_scene ( const bool reset_samples)
protected

Definition at line 673 of file session/session.cpp.

References params, profiler, progress, reset(), scene, and tile_manager_.

Referenced by run_update_for_next_iteration().

◆ update_status_time()

void Session::update_status_time ( bool show_pause = false,
bool show_done = false )
protected

◆ wait()

void Session::wait ( )

Member Data Documentation

◆ buffer_params_

◆ buffers_mutex_

thread_mutex Session::buffers_mutex_
protected

Definition at line 238 of file session/session.h.

Referenced by delayed_reset_buffer_params(), and run_main_render_loop().

◆ delayed_reset_

◆ denoise_device_

unique_ptr<Device> Session::denoise_device_

Definition at line 114 of file session/session.h.

Referenced by denoise_device(), Session(), and ~Session().

◆ device

◆ full_buffer_written_cb

std::function<void(string_view)> Session::full_buffer_written_cb

Definition at line 124 of file session/session.h.

Referenced by Session().

◆ new_work_added_

bool Session::new_work_added_ = false
protected

Definition at line 233 of file session/session.h.

Referenced by run_wait_for_work(), Session(), set_samples(), and set_time_limit().

◆ params

◆ path_trace_

◆ pause_

bool Session::pause_ = false
protected

Definition at line 232 of file session/session.h.

Referenced by cancel(), run_wait_for_work(), Session(), and set_pause().

◆ pause_cond_

thread_condition_variable Session::pause_cond_
protected

◆ pause_mutex_

thread_mutex Session::pause_mutex_
protected

◆ profiler

Profiler Session::profiler

Definition at line 119 of file session/session.h.

Referenced by collect_statistics(), Session(), thread_render(), and update_scene().

◆ progress

◆ render_scheduler_

◆ scene

◆ session_thread_

unique_ptr<thread> Session::session_thread_ = nullptr
protected

Definition at line 223 of file session/session.h.

Referenced by Session(), and ~Session().

◆ session_thread_cond_

thread_condition_variable Session::session_thread_cond_
protected

Definition at line 224 of file session/session.h.

Referenced by start(), thread_run(), wait(), and ~Session().

◆ session_thread_mutex_

thread_mutex Session::session_thread_mutex_
protected

Definition at line 225 of file session/session.h.

Referenced by is_session_thread_rendering(), start(), thread_run(), wait(), and ~Session().

◆ []

enum { ... } Session::session_thread_state_

◆ stats

Stats Session::stats

Definition at line 118 of file session/session.h.

Referenced by get_progress(), and Session().

◆ tile_manager_

◆ tile_mutex_

thread_mutex Session::tile_mutex_
protected

Definition at line 237 of file session/session.h.


The documentation for this class was generated from the following files: