|
Blender V5.0
|
#include <path_trace.h>
Public Attributes | |
| std::function< void(void)> | progress_update_cb |
Protected Attributes | |
| Device * | device_ = nullptr |
| Device * | denoise_device_ = nullptr |
| unique_ptr< Device > | cpu_device_ |
| Film * | film_ |
| DeviceScene * | device_scene_ |
| RenderScheduler & | render_scheduler_ |
| TileManager & | tile_manager_ |
| unique_ptr< PathTraceDisplay > | display_ |
| unique_ptr< OutputDriver > | output_driver_ |
| vector< unique_ptr< PathTraceWork > > | path_trace_works_ |
| vector< WorkBalanceInfo > | work_balance_infos_ |
| BufferParams | full_params_ |
| BufferParams | big_tile_params_ |
| unique_ptr< Denoiser > | denoiser_ |
| unique_ptr< PathTraceWork > | big_tile_denoise_work_ |
| struct { | |
| bool need_reset_params = false | |
| int resolution_divider = 0 | |
| BufferParams effective_big_tile_params | |
| bool has_denoised_result = false | |
| bool tile_written = false | |
| } | render_state_ |
| Progress * | progress_ |
| struct { | |
| bool is_rendering = false | |
| bool is_requested = false | |
| thread_mutex mutex | |
| thread_condition_variable condition | |
| } | render_cancel_ |
| bool | did_draw_after_reset_ = true |
| struct { | |
| RenderBuffers * render_buffers = nullptr | |
| } | full_frame_state_ |
Definition at line 44 of file path_trace.h.
| CCL_NAMESPACE_BEGIN PathTrace::PathTrace | ( | Device * | device, |
| Device * | denoise_device, | ||
| Film * | film, | ||
| DeviceScene * | device_scene, | ||
| RenderScheduler & | render_scheduler, | ||
| TileManager & | tile_manager ) |
Definition at line 28 of file path_trace.cpp.
References cpu_device_, PathTraceWork::create(), DCHECK_NE, denoise_device_, device_, device_cpu_create(), device_cpu_info(), device_scene_, film_, path_trace_works_, Device::profiler, render_cancel_, render_scheduler_, RenderScheduler::set_need_schedule_rebalance(), Device::stats, tile_manager_, work_balance_do_initial(), and work_balance_infos_.
| PathTrace::~PathTrace | ( | ) |
Definition at line 67 of file path_trace.cpp.
References destroy_gpu_resources().
|
protected |
Definition at line 449 of file path_trace.cpp.
References RenderWork::adaptive_sampling, atomic_add_and_fetch_u(), RenderWork::filter, is_cancel_requested(), LOG_DEBUG, path_trace_works_, render_scheduler_, RenderWork::reset, RenderWork::threshold, and time_dt().
Referenced by render_pipeline().
| void PathTrace::alloc_work_memory | ( | ) |
Definition at line 89 of file path_trace.cpp.
References path_trace_works_.
| void PathTrace::cancel | ( | ) |
Definition at line 883 of file path_trace.cpp.
References lock, and render_cancel_.
| void PathTrace::copy_from_render_buffers | ( | RenderBuffers * | render_buffers | ) |
Definition at line 1016 of file path_trace.cpp.
References path_trace_works_, and render_buffers.
Referenced by rebalance().
| bool PathTrace::copy_render_tile_from_device | ( | ) |
Definition at line 1025 of file path_trace.cpp.
References big_tile_denoise_work_, full_frame_state_, path_trace_works_, and render_state_.
| void PathTrace::copy_to_render_buffers | ( | RenderBuffers * | render_buffers | ) |
Definition at line 1007 of file path_trace.cpp.
References path_trace_works_, and render_buffers.
Referenced by denoise(), rebalance(), and tile_buffer_write_to_disk().
|
protected |
Definition at line 588 of file path_trace.cpp.
References RenderWork::cryptomatte, LOG_DEBUG, path_trace_works_, and RenderWork::postprocess.
Referenced by render_pipeline().
|
protected |
Definition at line 600 of file path_trace.cpp.
References big_tile_denoise_work_, copy_to_render_buffers(), PathTraceWork::create(), DCHECK_EQ, RenderWork::denoise, denoiser_, device_scene_, film_, get_num_samples_in_buffer(), LOG_DEBUG, path_trace_works_, render_scheduler_, render_state_, RenderBuffers::reset(), RenderWork::tile, and time_dt().
Referenced by render_pipeline().
|
protected |
Definition at line 652 of file path_trace.cpp.
References LOG_DEBUG, path_trace_works_, render_scheduler_, and time_dt().
Referenced by render_pipeline().
|
protected |
Definition at line 1220 of file path_trace.cpp.
References big_tile_denoise_work_, display_, and path_trace_works_.
Referenced by set_display_driver(), and ~PathTrace().
| void PathTrace::device_free | ( | ) |
Definition at line 144 of file path_trace.cpp.
References BufferParams::pass_stride, path_trace_works_, render_state_, and BufferParams::update_offset_stride().
| void PathTrace::draw | ( | ) |
Definition at line 699 of file path_trace.cpp.
References did_draw_after_reset_, and display_.
|
protected |
Definition at line 861 of file path_trace.cpp.
References RenderWork::full, LOG_DEBUG, tile_manager_, and RenderWork::write.
Referenced by render_pipeline().
| void PathTrace::flush_display | ( | ) |
Definition at line 708 of file path_trace.cpp.
References display_.
| string PathTrace::full_report | ( | ) | const |
Definition at line 1357 of file path_trace.cpp.
References denoiser_, denoiser_device_report(), path_trace_devices_report(), path_trace_works_, render_scheduler_, and result.
| int PathTrace::get_num_render_tile_samples | ( | ) | const |
Definition at line 1124 of file path_trace.cpp.
References full_frame_state_, and render_scheduler_.
|
protected |
Definition at line 896 of file path_trace.cpp.
References render_scheduler_.
Referenced by denoise(), and update_display().
| int2 PathTrace::get_render_size | ( | ) | const |
Definition at line 1201 of file path_trace.cpp.
References tile_manager_.
| int2 PathTrace::get_render_tile_offset | ( | ) | const |
Definition at line 1191 of file path_trace.cpp.
References full_frame_state_, make_int2(), tile, and tile_manager_.
| const BufferParams & PathTrace::get_render_tile_params | ( | ) | const |
Definition at line 1206 of file path_trace.cpp.
References big_tile_params_, and full_frame_state_.
| bool PathTrace::get_render_tile_pixels | ( | const PassAccessor & | pass_accessor, |
| const PassAccessor::Destination & | destination ) |
Definition at line 1133 of file path_trace.cpp.
References big_tile_denoise_work_, DENOISED, full_frame_state_, PassAccessor::get_pass_access_info(), PassAccessor::get_render_tile_pixels(), PassAccessor::PassAccessInfo::mode, path_trace_works_, and render_state_.
| int2 PathTrace::get_render_tile_size | ( | ) | const |
Definition at line 1180 of file path_trace.cpp.
References full_frame_state_, make_int2(), tile, and tile_manager_.
Referenced by progress_update_if_needed().
|
protected |
Definition at line 1473 of file path_trace.cpp.
References path_trace_works_, and render_scheduler_.
Referenced by render_pipeline().
|
protected |
Definition at line 1498 of file path_trace.cpp.
References LOG_DEBUG, and LOG_TRACE.
Referenced by render_pipeline().
| bool PathTrace::has_denoised_result | ( | ) | const |
|
protected |
Definition at line 383 of file path_trace.cpp.
References RenderWork::init_render_buffers, path_trace_works_, tile_buffer_read(), and update_work_buffer_params_if_needed().
Referenced by render_pipeline().
|
protected |
Definition at line 901 of file path_trace.cpp.
References progress_, and render_cancel_.
Referenced by adaptive_sample(), and path_trace().
| void PathTrace::load_kernels | ( | ) |
Definition at line 72 of file path_trace.cpp.
References denoiser_, display_, path_trace_works_, and progress_.
|
protected |
Definition at line 397 of file path_trace.cpp.
References DCHECK, PathTraceWork::get_device(), Device::have_error(), i, is_cancel_requested(), LOG_DEBUG, LOG_INFO, RenderWork::num_samples, PathTraceWork::RenderStatistics::occupancy, RenderWork::path_trace, path_trace_works_, PathTraceWork::render_samples(), render_scheduler_, RenderWork::resolution_divider, RenderWork::sample_offset, RenderWork::start_sample, thread_capture_fp_settings(), time_dt(), and work_balance_infos_.
Referenced by render_pipeline().
| void PathTrace::process_full_buffer_from_disk | ( | string_view | filename | ) |
Definition at line 1068 of file path_trace.cpp.
References cpu_device_, denoiser_, full_frame_state_, get_layer_view_name(), LOG_DEBUG, LOG_ERROR, RenderBuffers::params, progress_, progress_set_status(), render_scheduler_, render_state_, set_denoiser_params(), tile_buffer_write(), tile_manager_, DenoiseParams::use, and DenoiseParams::use_gpu.
|
protected |
Definition at line 1000 of file path_trace.cpp.
References progress_, and status.
Referenced by process_full_buffer_from_disk().
|
protected |
Definition at line 983 of file path_trace.cpp.
References get_render_tile_size(), RenderWork::num_samples, RenderWork::path_trace, progress_, progress_update_cb, RenderWork::sample_offset, RenderWork::start_sample, int2::x, and int2::y.
Referenced by render_pipeline().
| bool PathTrace::ready_to_reset | ( | ) |
Definition at line 96 of file path_trace.cpp.
References DCHECK, did_draw_after_reset_, and display_.
|
protected |
Definition at line 777 of file path_trace.cpp.
References copy_from_render_buffers(), copy_to_render_buffers(), cpu_device_, i, LOG_DEBUG, LOG_IS_ON, LOG_LEVEL_DEBUG, path_trace_works_, RenderWork::rebalance, render_scheduler_, render_state_, RenderBuffers::reset(), time_dt(), update_work_buffer_params_if_needed(), work_balance_do_rebalance(), and work_balance_infos_.
Referenced by render_pipeline().
| void PathTrace::render | ( | const RenderWork & | render_work | ) |
Definition at line 161 of file path_trace.cpp.
References lock, render_cancel_, and render_pipeline().
|
protected |
Definition at line 256 of file path_trace.cpp.
References path_trace_works_.
Referenced by render_pipeline().
|
protected |
Definition at line 183 of file path_trace.cpp.
References adaptive_sample(), cryptomatte_postprocess(), denoise(), denoise_volume_guiding_buffers(), device_scene_, finalize_full_buffer_on_disk(), guiding_prepare_structures(), guiding_update_structures(), init_render_buffers(), next_power_of_two(), path_trace(), progress_update_if_needed(), rebalance(), render_cancel_, render_init_kernel_execution(), render_scheduler_, update_display(), and write_tile_buffer().
Referenced by render().
| void PathTrace::reset | ( | const BufferParams & | full_params, |
| const BufferParams & | big_tile_params, | ||
| bool | reset_rendering ) |
Definition at line 120 of file path_trace.cpp.
References big_tile_params_, did_draw_after_reset_, display_, full_params_, and render_state_.
Referenced by set_guiding_params().
| void PathTrace::set_adaptive_sampling | ( | const AdaptiveSampling & | adaptive_sampling | ) |
Definition at line 583 of file path_trace.cpp.
References render_scheduler_.
| void PathTrace::set_denoiser_params | ( | const DenoiseParams & | params | ) |
Definition at line 508 of file path_trace.cpp.
References cpu_device_, Denoiser::create(), denoise_device_, denoiser_, DENOISER_OPENIMAGEDENOISE, DENOISER_OPTIX, DEVICE_CPU, display_, get_effective_denoise_params(), Device::info, params, render_cancel_, render_scheduler_, DenoiseParams::type, DeviceInfo::type, and DenoiseParams::use_gpu.
Referenced by process_full_buffer_from_disk().
| void PathTrace::set_display_driver | ( | unique_ptr< DisplayDriver > | driver | ) |
Definition at line 677 of file path_trace.cpp.
References destroy_gpu_resources(), and display_.
| void PathTrace::set_guiding_params | ( | const GuidingParams & | params, |
| const bool | reset ) |
Definition at line 1373 of file path_trace.cpp.
References GuidingParams::deterministic, device_, GUIDING_TYPE_DIRECTIONAL_QUAD_TREE, GUIDING_TYPE_PARALLAX_AWARE_VMM, GUIDING_TYPE_VMM, and reset().
| void PathTrace::set_output_driver | ( | unique_ptr< OutputDriver > | driver | ) |
Definition at line 672 of file path_trace.cpp.
References output_driver_.
| void PathTrace::set_progress | ( | Progress * | progress | ) |
Definition at line 156 of file path_trace.cpp.
References progress_.
| bool PathTrace::set_render_tile_pixels | ( | PassAccessor & | pass_accessor, |
| const PassAccessor::Source & | source ) |
Definition at line 1163 of file path_trace.cpp.
References path_trace_works_.
|
protected |
Definition at line 926 of file path_trace.cpp.
References device_scene_, output_driver_, path_trace_works_, and tile.
Referenced by init_render_buffers().
|
protected |
Definition at line 916 of file path_trace.cpp.
References output_driver_, and tile.
Referenced by process_full_buffer_from_disk(), and write_tile_buffer().
|
protected |
Definition at line 951 of file path_trace.cpp.
References big_tile_params_, buffers, copy_to_render_buffers(), cpu_device_, DCHECK_NE, device_, PASS_SAMPLE_COUNT, PASS_UNUSED, path_trace_works_, render_scheduler_, render_state_, RenderBuffers::reset(), and tile_manager_.
Referenced by write_tile_buffer().
|
protected |
Definition at line 310 of file path_trace.cpp.
References big_tile_params_, buffers, foreach_sliced_buffer_params(), PathTraceWork::get_render_buffers(), params, path_trace_works_, tile_manager_, and work_balance_infos_.
Referenced by update_work_buffer_params_if_needed().
|
protected |
Definition at line 717 of file path_trace.cpp.
References big_tile_denoise_work_, DENOISED, RenderWork::display, display_, film_, full_params_, get_num_samples_in_buffer(), has_denoised_result, is_volume_guiding_pass(), LOG_DEBUG, LOG_ERROR, NOISY, output_driver_, path_trace_works_, render_scheduler_, render_state_, tile, time_dt(), RenderWork::update, and RenderWork::use_denoised_result.
Referenced by render_pipeline().
|
protected |
Definition at line 345 of file path_trace.cpp.
References big_tile_params_, foreach_sliced_buffer_params(), full_params_, params, path_trace_works_, render_state_, resolution_divider, RenderWork::resolution_divider, scale_buffer_params(), PathTraceWork::set_effective_buffer_params(), tile_manager_, and work_balance_infos_.
Referenced by update_work_buffer_params_if_needed().
|
protected |
Definition at line 367 of file path_trace.cpp.
References render_state_, RenderWork::resolution_divider, update_allocated_work_buffer_params(), and update_effective_work_buffer_params().
Referenced by init_render_buffers(), and rebalance().
|
protected |
Definition at line 830 of file path_trace.cpp.
References LOG_DEBUG, render_state_, RenderWork::tile, tile_buffer_write(), tile_buffer_write_to_disk(), tile_manager_, and RenderWork::write.
Referenced by render_pipeline().
| void PathTrace::zero_display | ( | ) |
Definition at line 692 of file path_trace.cpp.
References display_.
|
protected |
Definition at line 291 of file path_trace.h.
Referenced by copy_render_tile_from_device(), denoise(), destroy_gpu_resources(), get_render_tile_pixels(), and update_display().
|
protected |
Definition at line 285 of file path_trace.h.
Referenced by get_render_tile_params(), reset(), tile_buffer_write_to_disk(), update_allocated_work_buffer_params(), and update_effective_work_buffer_params().
| thread_condition_variable PathTrace::condition |
Definition at line 349 of file path_trace.h.
|
protected |
Definition at line 262 of file path_trace.h.
Referenced by PathTrace(), process_full_buffer_from_disk(), rebalance(), set_denoiser_params(), and tile_buffer_write_to_disk().
Definition at line 259 of file path_trace.h.
Referenced by PathTrace(), and set_denoiser_params().
|
protected |
Definition at line 288 of file path_trace.h.
Referenced by denoise(), full_report(), load_kernels(), process_full_buffer_from_disk(), and set_denoiser_params().
Definition at line 255 of file path_trace.h.
Referenced by PathTrace(), set_guiding_params(), and tile_buffer_write_to_disk().
|
protected |
Definition at line 265 of file path_trace.h.
Referenced by denoise(), PathTrace(), render_pipeline(), and tile_buffer_read().
|
protected |
Definition at line 354 of file path_trace.h.
Referenced by draw(), ready_to_reset(), and reset().
|
protected |
Definition at line 271 of file path_trace.h.
Referenced by destroy_gpu_resources(), draw(), flush_display(), load_kernels(), ready_to_reset(), reset(), set_denoiser_params(), set_display_driver(), update_display(), and zero_display().
| BufferParams PathTrace::effective_big_tile_params |
Definition at line 325 of file path_trace.h.
|
protected |
Definition at line 264 of file path_trace.h.
Referenced by denoise(), PathTrace(), and update_display().
| struct { ... } PathTrace::full_frame_state_ |
|
protected |
Definition at line 284 of file path_trace.h.
Referenced by reset(), update_display(), and update_effective_work_buffer_params().
| bool PathTrace::has_denoised_result = false |
Definition at line 328 of file path_trace.h.
Referenced by update_display().
| bool PathTrace::is_rendering = false |
Definition at line 341 of file path_trace.h.
| bool PathTrace::is_requested = false |
Definition at line 344 of file path_trace.h.
| thread_mutex PathTrace::mutex |
Definition at line 348 of file path_trace.h.
| bool PathTrace::need_reset_params = false |
Definition at line 315 of file path_trace.h.
|
protected |
Definition at line 274 of file path_trace.h.
Referenced by set_output_driver(), tile_buffer_read(), tile_buffer_write(), and update_display().
|
protected |
Definition at line 278 of file path_trace.h.
Referenced by adaptive_sample(), alloc_work_memory(), copy_from_render_buffers(), copy_render_tile_from_device(), copy_to_render_buffers(), cryptomatte_postprocess(), denoise(), denoise_volume_guiding_buffers(), destroy_gpu_resources(), device_free(), full_report(), get_render_tile_pixels(), guiding_prepare_structures(), init_render_buffers(), load_kernels(), path_trace(), PathTrace(), rebalance(), render_init_kernel_execution(), set_render_tile_pixels(), tile_buffer_read(), tile_buffer_write_to_disk(), update_allocated_work_buffer_params(), update_display(), and update_effective_work_buffer_params().
|
protected |
Definition at line 336 of file path_trace.h.
Referenced by is_cancel_requested(), load_kernels(), process_full_buffer_from_disk(), progress_set_status(), progress_update_if_needed(), and set_progress().
| std::function<void(void)> PathTrace::progress_update_cb |
Definition at line 185 of file path_trace.h.
Referenced by progress_update_if_needed().
| RenderBuffers* PathTrace::render_buffers = nullptr |
Definition at line 358 of file path_trace.h.
Referenced by copy_from_render_buffers(), and copy_to_render_buffers().
| struct { ... } PathTrace::render_cancel_ |
Referenced by cancel(), is_cancel_requested(), PathTrace(), render(), render_pipeline(), and set_denoiser_params().
|
protected |
Definition at line 267 of file path_trace.h.
Referenced by adaptive_sample(), denoise(), denoise_volume_guiding_buffers(), full_report(), get_num_render_tile_samples(), get_num_samples_in_buffer(), guiding_prepare_structures(), path_trace(), PathTrace(), process_full_buffer_from_disk(), rebalance(), render_pipeline(), set_adaptive_sampling(), set_denoiser_params(), tile_buffer_write_to_disk(), and update_display().
| struct { ... } PathTrace::render_state_ |
Referenced by copy_render_tile_from_device(), denoise(), device_free(), get_render_tile_pixels(), process_full_buffer_from_disk(), rebalance(), reset(), tile_buffer_write_to_disk(), update_display(), update_effective_work_buffer_params(), update_work_buffer_params_if_needed(), and write_tile_buffer().
| int PathTrace::resolution_divider = 0 |
Definition at line 322 of file path_trace.h.
Referenced by update_effective_work_buffer_params().
|
protected |
Definition at line 268 of file path_trace.h.
Referenced by finalize_full_buffer_on_disk(), get_render_size(), get_render_tile_offset(), get_render_tile_size(), PathTrace(), process_full_buffer_from_disk(), tile_buffer_write_to_disk(), update_allocated_work_buffer_params(), update_effective_work_buffer_params(), and write_tile_buffer().
| bool PathTrace::tile_written = false |
Definition at line 332 of file path_trace.h.
|
protected |
Definition at line 281 of file path_trace.h.
Referenced by path_trace(), PathTrace(), rebalance(), update_allocated_work_buffer_params(), and update_effective_work_buffer_params().