Blender  V3.3
Classes | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
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
 
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 103 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 210 of file session/session.h.

Constructor & Destructor Documentation

◆ Session()

CCL_NAMESPACE_BEGIN Session::Session ( const SessionParams params,
const SceneParams scene_params 
)
explicit

◆ ~Session()

Session::~Session ( )

Member Function Documentation

◆ cancel()

void Session::cancel ( bool  quick = false)

◆ collect_statistics()

void Session::collect_statistics ( RenderStats stats)

◆ device_free()

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

◆ do_delayed_reset()

void Session::do_delayed_reset ( )
protected

◆ draw()

void Session::draw ( )

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

References path_trace_.

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

◆ get_effective_tile_size()

int2 Session::get_effective_tile_size ( ) const
protected

◆ get_estimated_remaining_time()

double Session::get_estimated_remaining_time ( ) const

◆ get_progress()

float Session::get_progress ( )

◆ is_session_thread_rendering()

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

◆ process_full_buffer_from_disk()

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

◆ ready_to_reset()

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

◆ reset()

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

◆ run_main_render_loop()

void Session::run_main_render_loop ( )
protected

◆ run_update_for_next_iteration()

RenderWork Session::run_update_for_next_iteration ( )
protected

◆ 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)

◆ set_output_driver()

void Session::set_output_driver ( unique_ptr< OutputDriver driver)

◆ set_pause()

void Session::set_pause ( bool  pause)

◆ set_samples()

void Session::set_samples ( int  samples)

◆ set_time_limit()

void Session::set_time_limit ( double  time_limit)

◆ start()

void Session::start ( )

◆ thread_render()

void Session::thread_render ( )
protected

◆ thread_run()

void Session::thread_run ( )
protected

◆ update_scene()

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

◆ 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_

BufferParams Session::buffer_params_
protected

◆ buffers_mutex_

thread_mutex Session::buffers_mutex_
protected

Definition at line 222 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

◆ device

Device* 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 217 of file session/session.h.

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

◆ params

SessionParams Session::params

◆ path_trace_

unique_ptr<PathTrace> Session::path_trace_
protected

◆ pause_

bool Session::pause_ = false
protected

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

Progress Session::progress

◆ render_scheduler_

RenderScheduler Session::render_scheduler_
protected

◆ scene

Scene* Session::scene

◆ session_thread_

thread* Session::session_thread_ = nullptr
protected

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

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

◆ session_thread_cond_

thread_condition_variable Session::session_thread_cond_
protected

Definition at line 208 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 209 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_

TileManager Session::tile_manager_
protected

◆ tile_mutex_

thread_mutex Session::tile_mutex_
protected

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


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