Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/integrator/path_trace_work.cpp
| Show All 15 Lines | |||||
| #include "device/device.h" | #include "device/device.h" | ||||
| #include "integrator/path_trace_work.h" | #include "integrator/path_trace_work.h" | ||||
| #include "integrator/path_trace_work_cpu.h" | #include "integrator/path_trace_work_cpu.h" | ||||
| #include "integrator/path_trace_work_gpu.h" | #include "integrator/path_trace_work_gpu.h" | ||||
| #include "render/buffers.h" | #include "render/buffers.h" | ||||
| #include "render/film.h" | #include "render/film.h" | ||||
| #include "render/gpu_display.h" | |||||
| #include "render/scene.h" | #include "render/scene.h" | ||||
| #include "kernel/kernel_types.h" | #include "kernel/kernel_types.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| unique_ptr<PathTraceWork> PathTraceWork::create(Device *device, | unique_ptr<PathTraceWork> PathTraceWork::create(Device *device, | ||||
| Film *film, | Film *film, | ||||
| Show All 24 Lines | |||||
| { | { | ||||
| } | } | ||||
| RenderBuffers *PathTraceWork::get_render_buffers() | RenderBuffers *PathTraceWork::get_render_buffers() | ||||
| { | { | ||||
| return buffers_.get(); | return buffers_.get(); | ||||
| } | } | ||||
| void PathTraceWork::set_effective_buffer_params(const BufferParams &effective_big_tile_params, | void PathTraceWork::set_effective_buffer_params(const BufferParams &effective_full_params, | ||||
| const BufferParams &effective_big_tile_params, | |||||
| const BufferParams &effective_buffer_params) | const BufferParams &effective_buffer_params) | ||||
| { | { | ||||
| effective_full_params_ = effective_full_params; | |||||
| effective_big_tile_params_ = effective_big_tile_params; | effective_big_tile_params_ = effective_big_tile_params; | ||||
| effective_buffer_params_ = effective_buffer_params; | effective_buffer_params_ = effective_buffer_params; | ||||
| } | } | ||||
| bool PathTraceWork::has_multiple_works() const | bool PathTraceWork::has_multiple_works() const | ||||
| { | { | ||||
| /* Assume if there are multiple works working on the same big tile none of the works gets the | /* Assume if there are multiple works working on the same big tile none of the works gets the | ||||
| * entire big tile to work on. */ | * entire big tile to work on. */ | ||||
| ▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | PassAccessor::PassAccessInfo PathTraceWork::get_display_pass_access_info(PassMode pass_mode) const | ||||
| pass_access_info.use_approximate_shadow_catcher_background = | pass_access_info.use_approximate_shadow_catcher_background = | ||||
| kfilm.use_approximate_shadow_catcher && !kbackground.transparent; | kfilm.use_approximate_shadow_catcher && !kbackground.transparent; | ||||
| pass_access_info.show_active_pixels = film_->get_show_active_pixels(); | pass_access_info.show_active_pixels = film_->get_show_active_pixels(); | ||||
| return pass_access_info; | return pass_access_info; | ||||
| } | } | ||||
| PassAccessor::Destination PathTraceWork::get_gpu_display_destination_template( | |||||
| const GPUDisplay *gpu_display) const | |||||
| { | |||||
| PassAccessor::Destination destination(film_->get_display_pass()); | |||||
| const int2 display_texture_size = gpu_display->get_texture_size(); | |||||
| const int texture_x = effective_buffer_params_.full_x - effective_full_params_.full_x; | |||||
| const int texture_y = effective_buffer_params_.full_y - effective_full_params_.full_y; | |||||
| destination.offset = texture_y * display_texture_size.x + texture_x; | |||||
| destination.stride = display_texture_size.x; | |||||
| return destination; | |||||
| } | |||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||