Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/integrator/path_trace.cpp
| Show First 20 Lines • Show All 345 Lines • ▼ Show 20 Lines | void PathTrace::path_trace(RenderWork &render_work) | ||||
| } | } | ||||
| VLOG(3) << "Will path trace " << render_work.path_trace.num_samples | VLOG(3) << "Will path trace " << render_work.path_trace.num_samples | ||||
| << " samples at the resolution divider " << render_work.resolution_divider; | << " samples at the resolution divider " << render_work.resolution_divider; | ||||
| const double start_time = time_dt(); | const double start_time = time_dt(); | ||||
| const int num_works = path_trace_works_.size(); | const int num_works = path_trace_works_.size(); | ||||
| tbb::parallel_for(0, num_works, [&](int i) { | tbb::parallel_for(0, num_works, [&](int i) { | ||||
| const double work_start_time = time_dt(); | const double work_start_time = time_dt(); | ||||
| const int num_samples = render_work.path_trace.num_samples; | |||||
| PathTraceWork *path_trace_work = path_trace_works_[i].get(); | PathTraceWork *path_trace_work = path_trace_works_[i].get(); | ||||
| path_trace_work->render_samples(render_work.path_trace.start_sample, | |||||
| render_work.path_trace.num_samples); | PathTraceWork::RenderStatistics statistics; | ||||
| work_balance_infos_[i].time_spent += time_dt() - work_start_time; | path_trace_work->render_samples(statistics, render_work.path_trace.start_sample, num_samples); | ||||
| const double work_time = time_dt() - work_start_time; | |||||
| work_balance_infos_[i].time_spent += work_time; | |||||
| work_balance_infos_[i].occupancy = statistics.occupancy; | |||||
| VLOG(3) << "Rendered " << num_samples << " samples in " << work_time << " seconds (" | |||||
| << work_time / num_samples | |||||
| << " seconds per sample), occupancy: " << statistics.occupancy; | |||||
| }); | }); | ||||
| float occupancy_accum = 0.0f; | |||||
| for (const WorkBalanceInfo &balance_info : work_balance_infos_) { | |||||
| occupancy_accum += balance_info.occupancy; | |||||
| } | |||||
| const float occupancy = occupancy_accum / num_works; | |||||
| render_scheduler_.report_path_trace_occupancy(render_work, occupancy); | |||||
| render_scheduler_.report_path_trace_time( | render_scheduler_.report_path_trace_time( | ||||
| render_work, time_dt() - start_time, is_cancel_requested()); | render_work, time_dt() - start_time, is_cancel_requested()); | ||||
| } | } | ||||
| void PathTrace::adaptive_sample(RenderWork &render_work) | void PathTrace::adaptive_sample(RenderWork &render_work) | ||||
| { | { | ||||
| if (!render_work.adaptive_sampling.filter) { | if (!render_work.adaptive_sampling.filter) { | ||||
| return; | return; | ||||
| ▲ Show 20 Lines • Show All 732 Lines • Show Last 20 Lines | |||||