Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/session.h
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | public: | ||||
| int threads; | int threads; | ||||
| /* Limit in seconds for how long path tracing is allowed to happen. | /* Limit in seconds for how long path tracing is allowed to happen. | ||||
| * Zero means no limit is applied. */ | * Zero means no limit is applied. */ | ||||
| double time_limit; | double time_limit; | ||||
| bool use_profiling; | bool use_profiling; | ||||
| bool use_auto_tile; | |||||
| int tile_size; | |||||
| ShadingSystem shadingsystem; | ShadingSystem shadingsystem; | ||||
| function<bool(const uchar *pixels, int width, int height, int channels)> write_render_cb; | function<bool(const uchar *pixels, int width, int height, int channels)> write_render_cb; | ||||
| SessionParams() | SessionParams() | ||||
| { | { | ||||
| headless = false; | headless = false; | ||||
| background = false; | background = false; | ||||
| experimental = false; | experimental = false; | ||||
| samples = 1024; | samples = 1024; | ||||
| pixel_size = 1; | pixel_size = 1; | ||||
| threads = 0; | threads = 0; | ||||
| time_limit = 0.0; | time_limit = 0.0; | ||||
| use_profiling = false; | use_profiling = false; | ||||
| use_auto_tile = true; | |||||
| tile_size = 2048; | |||||
| shadingsystem = SHADINGSYSTEM_SVM; | shadingsystem = SHADINGSYSTEM_SVM; | ||||
| } | } | ||||
| bool modified(const SessionParams ¶ms) const | bool modified(const SessionParams ¶ms) const | ||||
| { | { | ||||
| /* Modified means we have to recreate the session, any parameter changes | /* Modified means we have to recreate the session, any parameter changes | ||||
| * that can be handled by an existing Session are omitted. */ | * that can be handled by an existing Session are omitted. */ | ||||
| return !(device == params.device && headless == params.headless && | return !(device == params.device && headless == params.headless && | ||||
| background == params.background && experimental == params.experimental && | background == params.background && experimental == params.experimental && | ||||
| pixel_size == params.pixel_size && threads == params.threads && | pixel_size == params.pixel_size && threads == params.threads && | ||||
| use_profiling == params.use_profiling && shadingsystem == params.shadingsystem); | use_profiling == params.use_profiling && shadingsystem == params.shadingsystem && | ||||
| use_auto_tile == params.use_auto_tile && tile_size == params.tile_size); | |||||
| } | } | ||||
| }; | }; | ||||
| /* Session | /* Session | ||||
| * | * | ||||
| * This is the class that contains the session thread, running the render | * This is the class that contains the session thread, running the render | ||||
| * control loop and dispatching tasks. */ | * control loop and dispatching tasks. */ | ||||
| ▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | public: | ||||
| /* -------------------------------------------------------------------- | /* -------------------------------------------------------------------- | ||||
| * Tile and tile pixels aceess. | * Tile and tile pixels aceess. | ||||
| */ | */ | ||||
| /* Get size and offset (relative to the buffer's full x/y) of the currently rendering tile. */ | /* Get size and offset (relative to the buffer's full x/y) of the currently rendering tile. */ | ||||
| int2 get_render_tile_size() const; | int2 get_render_tile_size() const; | ||||
| int2 get_render_tile_offset() const; | int2 get_render_tile_offset() const; | ||||
| bool get_render_tile_done() const; | |||||
| bool has_multiple_render_tiles() const; | |||||
| bool copy_render_tile_from_device(); | bool copy_render_tile_from_device(); | ||||
| bool get_render_tile_pixels(const string &pass_name, int num_components, float *pixels); | bool get_render_tile_pixels(const string &pass_name, int num_components, float *pixels); | ||||
| bool set_render_tile_pixels(const string &pass_name, int num_components, const float *pixels); | bool set_render_tile_pixels(const string &pass_name, int num_components, const float *pixels); | ||||
| protected: | protected: | ||||
| struct DelayedReset { | struct DelayedReset { | ||||
| thread_mutex mutex; | thread_mutex mutex; | ||||
| Show All 28 Lines | protected: | ||||
| void run_main_render_loop(); | void run_main_render_loop(); | ||||
| bool update_scene(int width, int height); | bool update_scene(int width, int height); | ||||
| void update_status_time(bool show_pause = false, bool show_done = false); | void update_status_time(bool show_pause = false, bool show_done = false); | ||||
| void do_delayed_reset(); | void do_delayed_reset(); | ||||
| int2 get_effective_tile_size() const; | |||||
| thread *session_thread_; | thread *session_thread_; | ||||
| bool pause_ = false; | bool pause_ = false; | ||||
| bool cancel_ = false; | bool cancel_ = false; | ||||
| bool new_work_added_ = false; | bool new_work_added_ = false; | ||||
| thread_condition_variable pause_cond_; | thread_condition_variable pause_cond_; | ||||
| thread_mutex pause_mutex_; | thread_mutex pause_mutex_; | ||||
| Show All 19 Lines | |||||