Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/integrator/path_trace.cpp
| Show First 20 Lines • Show All 510 Lines • ▼ Show 20 Lines | void PathTrace::update_display(const RenderWork &render_work) | ||||
| gpu_display_->update_end(); | gpu_display_->update_end(); | ||||
| render_scheduler_.report_display_update_time(render_work, time_dt() - start_time); | render_scheduler_.report_display_update_time(render_work, time_dt() - start_time); | ||||
| } | } | ||||
| void PathTrace::rebalance(const RenderWork &render_work) | void PathTrace::rebalance(const RenderWork &render_work) | ||||
| { | { | ||||
| static const int kLogLevel = 3; | |||||
| scoped_timer timer; | |||||
| const int num_works = path_trace_works_.size(); | |||||
| if (!render_work.rebalance) { | if (!render_work.rebalance) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (path_trace_works_.size() == 1) { | if (num_works == 1) { | ||||
| VLOG(3) << "Ignoring rebalance work due to single device render."; | VLOG(kLogLevel) << "Ignoring rebalance work due to single device render."; | ||||
brecht: `VLOG(kLogLevel)`? | |||||
| return; | return; | ||||
| } | } | ||||
| VLOG(3) << "Perform rebalance work."; | if (VLOG_IS_ON(kLogLevel)) { | ||||
| VLOG(kLogLevel) << "Perform rebalance work."; | |||||
| VLOG(kLogLevel) << "Per-device path tracing time (seconds):"; | |||||
| for (int i = 0; i < num_works; ++i) { | |||||
| VLOG(kLogLevel) << path_trace_works_[i]->get_device()->info.description << ": " | |||||
| << work_balance_infos_[i].time_spent; | |||||
| } | |||||
| } | |||||
| if (!work_balance_do_rebalance(work_balance_infos_)) { | const bool did_rebalance = work_balance_do_rebalance(work_balance_infos_); | ||||
| VLOG(3) << "Balance in path trace works did not change."; | |||||
| if (VLOG_IS_ON(kLogLevel)) { | |||||
| VLOG(kLogLevel) << "Calculated per-device weights for works:"; | |||||
| for (int i = 0; i < num_works; ++i) { | |||||
| LOG(INFO) << path_trace_works_[i]->get_device()->info.description << ": " | |||||
| << work_balance_infos_[i].weight; | |||||
| } | |||||
| } | |||||
| if (!did_rebalance) { | |||||
| VLOG(kLogLevel) << "Balance in path trace works did not change."; | |||||
Not Done Inline ActionsVLOG(kLogLevel)? brecht: `VLOG(kLogLevel)`? | |||||
| return; | return; | ||||
| } | } | ||||
| /* TODO(sergey): Update buffer allocation, and copy data across devices as needed. */ | TempCPURenderBuffers big_tile_cpu_buffers(device_); | ||||
| big_tile_cpu_buffers.buffers->reset(render_state_.effective_big_tile_params); | |||||
| copy_to_render_buffers(big_tile_cpu_buffers.buffers.get()); | |||||
| render_state_.need_reset_params = true; | |||||
| update_work_buffer_params_if_needed(render_work); | |||||
| copy_from_render_buffers(big_tile_cpu_buffers.buffers.get()); | |||||
| VLOG(kLogLevel) << "Rebalance time (seconds): " << timer.get_time(); | |||||
| } | } | ||||
| void PathTrace::cancel() | void PathTrace::cancel() | ||||
| { | { | ||||
| thread_scoped_lock lock(render_cancel_.mutex); | thread_scoped_lock lock(render_cancel_.mutex); | ||||
| render_cancel_.is_requested = true; | render_cancel_.is_requested = true; | ||||
| ▲ Show 20 Lines • Show All 266 Lines • Show Last 20 Lines | |||||
VLOG(kLogLevel)?