Fix 114336: Cycles crash switching render pass in the viewport
This commit is contained in:
@@ -54,6 +54,11 @@ bool PathTraceTile::get_pass_pixels(const string_view pass_name,
|
||||
}
|
||||
|
||||
pass = buffer_params.get_actual_display_pass(pass);
|
||||
if (pass == nullptr) {
|
||||
/* Happens when interactive sesssion changes display pass but render
|
||||
* buffer does not contain it yet. */
|
||||
return false;
|
||||
}
|
||||
|
||||
const float exposure = buffer_params.exposure;
|
||||
const int num_samples = path_trace_.get_num_render_tile_samples();
|
||||
|
||||
@@ -154,6 +154,11 @@ PassAccessor::PassAccessInfo PathTraceWork::get_display_pass_access_info(PassMod
|
||||
const BufferParams ¶ms = buffers_->params;
|
||||
|
||||
const BufferPass *display_pass = params.get_actual_display_pass(film_->get_display_pass());
|
||||
if (display_pass == nullptr) {
|
||||
/* Happens when interactive sesssion changes display pass but render
|
||||
* buffer does not contain it yet. */
|
||||
return PassAccessor::PassAccessInfo();
|
||||
}
|
||||
|
||||
PassAccessor::PassAccessInfo pass_access_info;
|
||||
pass_access_info.type = display_pass->type;
|
||||
|
||||
@@ -176,6 +176,9 @@ void PathTraceWorkCPU::copy_to_display(PathTraceDisplay *display,
|
||||
const KernelFilm &kfilm = device_scene_->data.film;
|
||||
|
||||
const PassAccessor::PassAccessInfo pass_access_info = get_display_pass_access_info(pass_mode);
|
||||
if (pass_access_info.type == PASS_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
const PassAccessorCPU pass_accessor(pass_access_info, kfilm.exposure, num_samples);
|
||||
|
||||
|
||||
@@ -1025,6 +1025,10 @@ void PathTraceWorkGPU::get_render_tile_film_pixels(const PassAccessor::Destinati
|
||||
const KernelFilm &kfilm = device_scene_->data.film;
|
||||
|
||||
const PassAccessor::PassAccessInfo pass_access_info = get_display_pass_access_info(pass_mode);
|
||||
if (pass_access_info.type == PASS_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
const PassAccessorGPU pass_accessor(queue_.get(), pass_access_info, kfilm.exposure, num_samples);
|
||||
|
||||
pass_accessor.get_render_tile_pixels(buffers_.get(), effective_buffer_params_, destination);
|
||||
|
||||
Reference in New Issue
Block a user