Blender V4.3
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 (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

Devicedevice
 
Devicedenoise_device
 
Scenescene
 
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_
 
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 108 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 217 of file session/session.h.

Constructor & Destructor Documentation

◆ Session()

◆ ~Session()

Member Function Documentation

◆ cancel()

◆ collect_statistics()

void Session::collect_statistics ( RenderStats * stats)

◆ device_free()

void Session::device_free ( )

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

References path_trace_.

Referenced by BlenderSession::render_frame_finish().

◆ do_delayed_reset()

◆ draw()

void Session::draw ( )

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

References path_trace_.

Referenced by BlenderSession::draw(), and BlenderSession::view_draw().

◆ get_effective_tile_size()

◆ get_estimated_remaining_time()

◆ get_progress()

float Session::get_progress ( )

◆ is_session_thread_rendering()

bool Session::is_session_thread_rendering ( )
protected

Definition at line 298 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 768 of file session/session.cpp.

References path_trace_.

Referenced by BlenderSession::render_frame_finish().

◆ ready_to_reset()

bool Session::ready_to_reset ( )

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

References path_trace_.

Referenced by BlenderSession::synchronize(), and BlenderSession::view_draw().

◆ reset()

◆ run_main_render_loop()

◆ run_update_for_next_iteration()

◆ run_wait_for_work()

◆ set_display_driver()

◆ set_output_driver()

void Session::set_output_driver ( unique_ptr< OutputDriver > driver)

◆ set_pause()

◆ set_samples()

void Session::set_samples ( int samples)

◆ set_time_limit()

void Session::set_time_limit ( double time_limit)

◆ start()

◆ thread_render()

◆ thread_run()

◆ update_scene()

bool Session::update_scene ( int width,
int height )
protected

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

References progress, and Camera::set_screen_size().

Referenced by run_update_for_next_iteration().

◆ update_status_time()

◆ wait()

Member Data Documentation

◆ buffer_params_

BufferParams Session::buffer_params_
protected

◆ buffers_mutex_

thread_mutex Session::buffers_mutex_
protected

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

Referenced by run_main_render_loop(), and run_update_for_next_iteration().

◆ delayed_reset_

struct Session::DelayedReset Session::delayed_reset_
protected

◆ denoise_device

Device* Session::denoise_device

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

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

◆ device

◆ full_buffer_written_cb

function<void(string_view)> Session::full_buffer_written_cb

◆ new_work_added_

bool Session::new_work_added_ = false
protected

Definition at line 224 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 223 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

◆ progress

◆ render_scheduler_

◆ scene

◆ session_thread_

thread* Session::session_thread_ = nullptr
protected

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

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

◆ session_thread_cond_

thread_condition_variable Session::session_thread_cond_
protected

Definition at line 215 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 216 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

◆ tile_manager_

◆ tile_mutex_

thread_mutex Session::tile_mutex_
protected

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


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