Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/session.h
| Show All 17 Lines | |||||
| #define __SESSION_H__ | #define __SESSION_H__ | ||||
| #include "device/device.h" | #include "device/device.h" | ||||
| #include "render/buffers.h" | #include "render/buffers.h" | ||||
| #include "render/shader.h" | #include "render/shader.h" | ||||
| #include "render/stats.h" | #include "render/stats.h" | ||||
| #include "render/tile.h" | #include "render/tile.h" | ||||
| #include "util/util_api.h" | |||||
| #include "util/util_progress.h" | #include "util/util_progress.h" | ||||
| #include "util/util_stats.h" | #include "util/util_stats.h" | ||||
| #include "util/util_thread.h" | #include "util/util_thread.h" | ||||
| #include "util/util_vector.h" | #include "util/util_vector.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| class BufferParams; | class BufferParams; | ||||
| ▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | |||||
| }; | }; | ||||
| /* 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. */ | ||||
| class Session { | class Session { | ||||
| public: | private: | ||||
| Device *device; | GET(Device *, device) | ||||
| Scene *scene; | GET_SET(Scene *, scene) | ||||
| RenderBuffers *buffers; | GET(RenderBuffers *, buffers) | ||||
| DisplayBuffer *display; | GET(DisplayBuffer *, display) | ||||
| Progress progress; | GET(Progress, progress) | ||||
| SessionParams params; | GET(SessionParams, params) | ||||
| TileManager tile_manager; | GET(TileManager, tile_manager) | ||||
| Stats stats; | GET(Stats, stats) | ||||
| Profiler profiler; | GET(Profiler, profiler) | ||||
| function<void(RenderTile &)> write_render_tile_cb; | GET_SET(function<void(RenderTile &)>, write_render_tile_cb) | ||||
| function<void(RenderTile &, bool)> update_render_tile_cb; | GET_SET(function<void(RenderTile &, bool)>, update_render_tile_cb) | ||||
| function<void(RenderTile &)> read_bake_tile_cb; | GET_SET(function<void(RenderTile &)>, read_bake_tile_cb) | ||||
| public: | |||||
| explicit Session(const SessionParams ¶ms); | explicit Session(const SessionParams ¶ms); | ||||
| ~Session(); | ~Session(); | ||||
| void start(); | void start(); | ||||
| void cancel(); | void cancel(); | ||||
| bool draw(BufferParams ¶ms, DeviceDrawParams &draw_params); | bool draw(BufferParams ¶ms, DeviceDrawParams &draw_params); | ||||
| void wait(); | void wait(); | ||||
| bool ready_to_reset(); | bool ready_to_reset(); | ||||
| void reset(BufferParams ¶ms, int samples); | void reset(BufferParams ¶ms, int samples); | ||||
| void set_pause(bool pause); | void set_pause(bool pause); | ||||
| void set_samples(int samples); | void set_samples(int samples); | ||||
| void set_denoising(const DenoiseParams &denoising); | void set_denoising(const DenoiseParams &denoising); | ||||
| void set_denoising_start_sample(int sample); | void set_denoising_start_sample(int sample); | ||||
| bool update_scene(); | bool update_scene(); | ||||
| void device_free(); | void device_free(); | ||||
| /* Returns the rendering progress or 0 if no progress can be determined | |||||
| * (for example, when rendering with unlimited samples). */ | |||||
| float get_progress(); | |||||
| void collect_statistics(RenderStats *stats); | void collect_statistics(RenderStats *stats); | ||||
| protected: | protected: | ||||
| struct DelayedReset { | struct DelayedReset { | ||||
| thread_mutex mutex; | thread_mutex mutex; | ||||
| bool do_reset; | bool do_reset; | ||||
| BufferParams params; | BufferParams params; | ||||
| int samples; | int samples; | ||||
| ▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines | |||||