31 :
params(params_), render_scheduler_(tile_manager_,
params)
42 if (
device->have_error()) {
46 scene = make_unique<Scene>(scene_params,
device.get());
172 VLOG_INFO <<
"Rendering in main loop is done in " << render_time <<
" seconds.";
196 if (
device->have_error()) {
217 if (
device->have_error()) {
315 bool have_tiles =
true;
316 bool switched_to_new_tile =
false;
323 switched_to_new_tile =
true;
335 path_trace_->set_adaptive_sampling(adaptive_sampling);
341 const bool guiding_reset = (guiding_params.
use) ? reset_scene :
false;
342 path_trace_->set_guiding_params(guiding_params, guiding_reset);
362 switched_to_new_tile =
true;
369 if (switched_to_new_tile) {
409 string device_status;
410 while (!
device->is_ready(device_status)) {
415 std::this_thread::sleep_for(std::chrono::milliseconds(200));
433 if (!
pause_ && render_work) {
438 const bool no_work = !render_work;
486 const int64_t actual_tile_area =
static_cast<int64_t>(tile_size) * tile_size;
517 scene->film->get_use_approximate_shadow_catcher();
567 scene->scene_updated_while_loading_kernels =
true;
637 path_trace_->set_display_driver(std::move(driver));
643 if (completed == 0.0) {
650 double remaining = (1.0 - (double)completed) * (render_time / (double)completed);
654 if (time_limit != 0.0) {
655 remaining =
min(remaining,
max(time_limit - render_time, 0.0));
703 string prefix = status;
704 if (!prefix.empty()) {
707 return prefix + suffix;
737 string device_status;
738 if (
device->is_ready(device_status) && !device_status.empty()) {
745 status =
"Rendering Paused";
747 else if (show_done) {
748 status =
"Rendering Done";
761 scene->device_free();
767 scene->collect_statistics(render_stats);
779 path_trace_->process_full_buffer_from_disk(filename);
static constexpr int image_width
static constexpr int image_height
void reset()
clear internal cached data and reset random seed
bool use_approximate_shadow_catcher
void update_offset_stride()
bool use_transparent_background
static unique_ptr< Device > create(const DeviceInfo &info, Stats &stats, Profiler &profiler, bool headless)
static const int MAX_SAMPLES
void reset(const int num_shaders, const int num_objects)
int get_current_sample() const
void set_cancel(const string &cancel_message_)
string get_cancel_message() const
void set_total_pixel_samples(const uint64_t total_pixel_samples_)
void get_time(double &total_time_, double &render_time_) const
void set_status(const string &status_, const string &substatus_="")
void set_error(const string &error_message_)
double get_progress() const
void set_render_start_time()
void add_finished_tile(bool denoised)
void add_skip_time(const scoped_timer &start_timer, bool only_render)
int get_rendered_tiles() const
void set_time_limit(const double time_limit_)
void set_time_limit(const double time_limit)
void reset_for_next_tile()
double get_time_limit() const
int get_num_samples() const
void set_sample_params(const int num_samples, const bool use_sample_subset, const int sample_subset_offset, const int sample_subset_length)
void reset(const BufferParams &buffer_params)
void render_work_reschedule_on_cancel(RenderWork &render_work)
RenderWork get_render_work()
DeviceInfo denoise_device
unique_ptr< Scene > scene
void collect_statistics(RenderStats *stats)
RenderScheduler render_scheduler_
unique_ptr< thread > session_thread_
void update_status_time(bool show_pause=false, bool show_done=false)
enum Session::@1433 session_thread_state_
void set_pause(bool pause)
thread_mutex pause_mutex_
Device * denoise_device()
int2 get_effective_tile_size() const
void process_full_buffer_from_disk(string_view filename)
void set_display_driver(unique_ptr< DisplayDriver > driver)
std::function< void(string_view)> full_buffer_written_cb
void cancel(bool quick=false)
thread_condition_variable pause_cond_
bool update_scene(const bool reset_samples)
bool run_wait_for_work(const RenderWork &render_work)
double get_estimated_remaining_time() const
thread_condition_variable session_thread_cond_
Session(const SessionParams ¶ms, const SceneParams &scene_params)
void update_buffers_for_params()
void run_main_render_loop()
thread_mutex session_thread_mutex_
BufferParams buffer_params_
unique_ptr< Device > denoise_device_
RenderWork run_update_for_next_iteration()
void set_time_limit(const double time_limit)
void reset(const SessionParams &session_params, const BufferParams &buffer_params)
bool is_session_thread_rendering()
void set_samples(const int samples)
unique_ptr< Device > device
thread_mutex buffers_mutex_
void set_output_driver(unique_ptr< OutputDriver > driver)
struct Session::DelayedReset delayed_reset_
bool delayed_reset_buffer_params()
unique_ptr< PathTrace > path_trace_
TileManager tile_manager_
static void init(const int num_threads=0)
void set_temp_dir(const string &temp_dir)
int compute_render_tile_size(const int suggested_tile_size) const
bool has_multiple_tiles() const
void update(const BufferParams ¶ms, const Scene *scene)
const Tile & get_current_tile() const
int get_num_tiles() const
std::function< void(string_view)> full_buffer_written_cb
static const int MAX_TILE_SIZE
void reset_scheduling(const BufferParams ¶ms, const int2 tile_size)
#define CCL_NAMESPACE_END
ccl_gpu_kernel_postfix ccl_global KernelWorkTile const int num_tiles
const ccl_global KernelWorkTile * tile
static string status_append(const string &status, const string &suffix)
unsigned __int64 uint64_t
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
void collect_profiling(Scene *scene, Profiler &prof)
SessionParams session_params
BufferParams buffer_params
std::unique_lock< std::mutex > thread_scoped_lock
Vector< SampleData< T > > samples