45 if (
device->have_error()) {
49 scene = make_unique<Scene>(scene_params,
device.get());
175 LOG_INFO <<
"Rendering was canceled.";
181 LOG_INFO <<
"Rendering in main loop is done in " << render_time <<
" seconds.";
205 if (
device->have_error()) {
226 if (
device->have_error()) {
324 bool have_tiles =
true;
325 bool switched_to_new_tile =
false;
332 switched_to_new_tile =
true;
346 path_trace_->set_adaptive_sampling(adaptive_sampling);
352 const bool guiding_reset = (guiding_params.
use) ? reset_scene :
false;
353 path_trace_->set_guiding_params(guiding_params, guiding_reset);
373 switched_to_new_tile =
true;
385 if (switched_to_new_tile) {
425 string device_status;
426 while (!
device->is_ready(device_status)) {
431 std::this_thread::sleep_for(std::chrono::milliseconds(200));
449 if (!
pause_ && render_work) {
454 const bool no_work = !render_work;
467 if (wait_time == std::chrono::milliseconds::zero()) {
474 if (wait_time == std::chrono::milliseconds::max()) {
505 return make_int2(image_width, image_height);
508 const int64_t image_area =
static_cast<int64_t>(image_width) * image_height;
514 const int64_t actual_tile_area =
static_cast<int64_t>(tile_size) * tile_size;
519 return make_int2(image_width, image_height);
545 scene->film->get_use_approximate_shadow_catcher();
595 scene->scene_updated_while_loading_kernels =
true;
670 path_trace_->set_display_driver(std::move(driver));
676 if (completed == 0.0) {
683 double remaining = (1.0 - (double)completed) * (render_time / (
double)completed);
687 if (time_limit != 0.0) {
688 remaining =
min(remaining,
max(time_limit - render_time, 0.0));
736 string prefix = status;
737 if (!prefix.empty()) {
740 return prefix + suffix;
770 string device_status;
771 if (
device->is_ready(device_status) && !device_status.empty()) {
778 status =
"Rendering Paused";
780 else if (show_done) {
781 status =
"Rendering Done";
794 scene->device_free();
800 scene->collect_statistics(render_stats);
812 path_trace_->process_full_buffer_from_disk(filename);
unsigned long long int uint64_t
bool use_approximate_shadow_catcher
void update_offset_stride()
bool use_transparent_background
void set_navigating(bool navigating)
std::chrono::milliseconds wait_time(bool idle) const
bool need_eviction(bool idle, bool switched_to_new_tile)
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()
void collect_profiling(Scene *scene, Profiler &prof)
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)
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)
void set_navigating(bool navigating)
enum Session::@056371222103363167122077335031026143326111101235 session_thread_state_
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()
CacheEvictionManager eviction_manager_
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)
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
SessionParams session_params
BufferParams buffer_params
std::unique_lock< std::mutex > thread_scoped_lock