Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/integrator/path_trace_work.h
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | public: | ||||
| /* Access the render buffers. | /* Access the render buffers. | ||||
| * | * | ||||
| * Is only supposed to be used by the PathTrace to update buffer allocation and slicing to | * Is only supposed to be used by the PathTrace to update buffer allocation and slicing to | ||||
| * correspond to the big tile size and relative device performance. */ | * correspond to the big tile size and relative device performance. */ | ||||
| RenderBuffers *get_render_buffers(); | RenderBuffers *get_render_buffers(); | ||||
| /* Set effective parameters of the big tile and the work itself. */ | /* Set effective parameters of the big tile and the work itself. */ | ||||
| void set_effective_buffer_params(const BufferParams &effective_big_tile_params, | void 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); | ||||
| /* Check whether the big tile is being worked on by multiple path trace works. */ | /* Check whether the big tile is being worked on by multiple path trace works. */ | ||||
| bool has_multiple_works() const; | bool has_multiple_works() const; | ||||
| /* Allocate working memory for execution. Must be called before init_execution(). */ | /* Allocate working memory for execution. Must be called before init_execution(). */ | ||||
| virtual void alloc_work_memory(){}; | virtual void alloc_work_memory(){}; | ||||
| /* Initialize execution of kernels. | /* Initialize execution of kernels. | ||||
| * Will ensure that all device queues are initialized for execution. | * Will ensure that all device queues are initialized for execution. | ||||
| * | * | ||||
| * This method is to be called after any change in the scene. It is not needed to call it prior | * This method is to be called after any change in the scene. It is not needed to call it prior | ||||
| * to an every call of the `render_samples()`. */ | * to an every call of the `render_samples()`. */ | ||||
| virtual void init_execution() = 0; | virtual void init_execution() = 0; | ||||
| /* Render given number of samples as a synchronous blocking call. | /* Render given number of samples as a synchronous blocking call. | ||||
| * The samples are added to the render buffer associated with this work. */ | * The samples are added to the render buffer associated with this work. */ | ||||
| virtual void render_samples(int start_sample, int samples_num) = 0; | virtual void render_samples(int start_sample, int samples_num) = 0; | ||||
| /* Copy render result from this work to the corresponding place of the GPU display. | /* Copy render result from this work to the corresponding place of the GPU display. | ||||
| * The pass_mode indicates whether to access denoised or noisy version of the display pass. The | * | ||||
| * The `pass_mode` indicates whether to access denoised or noisy version of the display pass. The | |||||
| * noisy pass mode will be passed here when it is known that the buffer does not have denoised | * noisy pass mode will be passed here when it is known that the buffer does not have denoised | ||||
| * passes yet (because denoiser did not run). If the denoised pass is requested and denoiser is | * passes yet (because denoiser did not run). If the denoised pass is requested and denoiser is | ||||
| * not used then this function will fall-back to the noisy pass instead. */ | * not used then this function will fall-back to the noisy pass instead. */ | ||||
| virtual void copy_to_gpu_display(GPUDisplay *gpu_display, | virtual void copy_to_gpu_display(GPUDisplay *gpu_display, | ||||
| PassMode pass_mode, | PassMode pass_mode, | ||||
| int num_samples) = 0; | int num_samples) = 0; | ||||
| /* Copy data from/to given render buffers. | /* Copy data from/to given render buffers. | ||||
| ▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||
| protected: | protected: | ||||
| PathTraceWork(Device *device, | PathTraceWork(Device *device, | ||||
| Film *film, | Film *film, | ||||
| DeviceScene *device_scene, | DeviceScene *device_scene, | ||||
| bool *cancel_requested_flag); | bool *cancel_requested_flag); | ||||
| PassAccessor::PassAccessInfo get_display_pass_access_info(PassMode pass_mode) const; | PassAccessor::PassAccessInfo get_display_pass_access_info(PassMode pass_mode) const; | ||||
| /* Get destination which offset and stride are configured so that writing to it will write to a | |||||
| * proper location of GPU display texture, taking current tile and device slice into account. */ | |||||
| PassAccessor::Destination get_gpu_display_destination_template( | |||||
| const GPUDisplay *gpu_display) const; | |||||
| /* Device which will be used for path tracing. | /* Device which will be used for path tracing. | ||||
| * Note that it is an actual render device (and never is a multi-device). */ | * Note that it is an actual render device (and never is a multi-device). */ | ||||
| Device *device_; | Device *device_; | ||||
| /* Film is used to access display pass configuration for GPU display update. | /* Film is used to access display pass configuration for GPU display update. | ||||
| * Note that only fields which are not a part of kernel data can be accessed via the Film. */ | * Note that only fields which are not a part of kernel data can be accessed via the Film. */ | ||||
| Film *film_; | Film *film_; | ||||
| /* Device side scene storage, that may be used for integrator logic. */ | /* Device side scene storage, that may be used for integrator logic. */ | ||||
| DeviceScene *device_scene_; | DeviceScene *device_scene_; | ||||
| /* Render buffers where sampling is being accumulated into, allocated for a fraction of the big | /* Render buffers where sampling is being accumulated into, allocated for a fraction of the big | ||||
| * tile which is being rendered by this work. | * tile which is being rendered by this work. | ||||
| * It also defines possible subset of a big tile in the case of multi-device rendering. */ | * It also defines possible subset of a big tile in the case of multi-device rendering. */ | ||||
| unique_ptr<RenderBuffers> buffers_; | unique_ptr<RenderBuffers> buffers_; | ||||
| /* Effective parameters of the big tile and render buffer. | /* Effective parameters of the full, big tile, and current work render buffer. | ||||
| * The latter might be different from buffers_->params when there is a resolution divider | * The latter might be different from buffers_->params when there is a resolution divider | ||||
| * involved. */ | * involved. */ | ||||
| BufferParams effective_full_params_; | |||||
| BufferParams effective_big_tile_params_; | BufferParams effective_big_tile_params_; | ||||
| BufferParams effective_buffer_params_; | BufferParams effective_buffer_params_; | ||||
| bool *cancel_requested_flag_ = nullptr; | bool *cancel_requested_flag_ = nullptr; | ||||
| }; | }; | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||