Cycles: Viewport Rendering Memory Improvement
Small memory reduction change by only storing the pixels of the combined pass when it is being shown in the viewport. Previously the combined pass was always calculated and present in the output buffer. The combined pass will still be calculated. It is a limitation in Blender that Cycles always had a combined pass. This patch will remove the limitation from the code base of Cycles. Blender still has the limitation, but will always request the combined renderpass when doing final rendering. Reviewed By: brecht Differential Revision: https://developer.blender.org/D5784
This commit is contained in:
parent
11b0c2080c
commit
271c6794d6
|
@ -899,7 +899,7 @@ BufferParams BlenderSync::get_buffer_params(BL::RenderSettings &b_render,
|
|||
params.height = height;
|
||||
}
|
||||
|
||||
update_viewport_display_passes(b_v3d, params.passes, false);
|
||||
update_viewport_display_passes(b_v3d, params.passes);
|
||||
|
||||
return params;
|
||||
}
|
||||
|
|
|
@ -344,7 +344,7 @@ void BlenderSync::sync_film(BL::SpaceView3D &b_v3d)
|
|||
Film prevfilm = *film;
|
||||
|
||||
if (b_v3d) {
|
||||
film->display_pass = update_viewport_display_passes(b_v3d, film->passes, true);
|
||||
film->display_pass = update_viewport_display_passes(b_v3d, film->passes);
|
||||
}
|
||||
|
||||
film->exposure = get_float(cscene, "film_exposure");
|
||||
|
@ -520,7 +520,6 @@ int BlenderSync::get_denoising_pass(BL::RenderPass &b_pass)
|
|||
vector<Pass> BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_view_layer)
|
||||
{
|
||||
vector<Pass> passes;
|
||||
Pass::add(PASS_COMBINED, passes);
|
||||
|
||||
/* loop over passes */
|
||||
BL::RenderLayer::passes_iterator b_pass_iter;
|
||||
|
|
|
@ -72,23 +72,13 @@ PassType BlenderViewportParameters::get_viewport_display_render_pass(BL::SpaceVi
|
|||
return display_pass;
|
||||
}
|
||||
|
||||
PassType update_viewport_display_passes(BL::SpaceView3D &b_v3d,
|
||||
vector<Pass> &passes,
|
||||
bool reset_passes)
|
||||
PassType update_viewport_display_passes(BL::SpaceView3D &b_v3d, vector<Pass> &passes)
|
||||
{
|
||||
if (b_v3d) {
|
||||
PassType display_pass = BlenderViewportParameters::get_viewport_display_render_pass(b_v3d);
|
||||
|
||||
if (reset_passes) {
|
||||
passes.clear();
|
||||
/* We always need a combined pass for now. It would be a good optimization
|
||||
* to support rendering without combined pass. */
|
||||
Pass::add(PASS_COMBINED, passes);
|
||||
}
|
||||
|
||||
if (display_pass != PASS_COMBINED) {
|
||||
Pass::add(display_pass, passes);
|
||||
}
|
||||
passes.clear();
|
||||
Pass::add(display_pass, passes);
|
||||
|
||||
return display_pass;
|
||||
}
|
||||
|
|
|
@ -49,9 +49,7 @@ class BlenderViewportParameters {
|
|||
static PassType get_viewport_display_render_pass(BL::SpaceView3D &b_v3d);
|
||||
};
|
||||
|
||||
PassType update_viewport_display_passes(BL::SpaceView3D &b_v3d,
|
||||
vector<Pass> &passes,
|
||||
bool reset_passes);
|
||||
PassType update_viewport_display_passes(BL::SpaceView3D &b_v3d, vector<Pass> &passes);
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
|
|
|
@ -397,7 +397,9 @@ ccl_device_inline void kernel_write_result(KernelGlobals *kg,
|
|||
float alpha;
|
||||
float3 L_sum = path_radiance_clamp_and_sum(kg, L, &alpha);
|
||||
|
||||
kernel_write_pass_float4(buffer, make_float4(L_sum.x, L_sum.y, L_sum.z, alpha));
|
||||
if (kernel_data.film.pass_flag & PASSMASK(COMBINED)) {
|
||||
kernel_write_pass_float4(buffer, make_float4(L_sum.x, L_sum.y, L_sum.z, alpha));
|
||||
}
|
||||
|
||||
kernel_write_light_passes(kg, buffer, L);
|
||||
|
||||
|
|
|
@ -43,8 +43,6 @@ BufferParams::BufferParams()
|
|||
denoising_data_pass = false;
|
||||
denoising_clean_pass = false;
|
||||
denoising_prefiltered_pass = false;
|
||||
|
||||
Pass::add(PASS_COMBINED, passes);
|
||||
}
|
||||
|
||||
void BufferParams::get_offset_stride(int &offset, int &stride)
|
||||
|
|
|
@ -293,8 +293,6 @@ NODE_DEFINE(Film)
|
|||
|
||||
Film::Film() : Node(node_type)
|
||||
{
|
||||
Pass::add(PASS_COMBINED, passes);
|
||||
|
||||
use_light_visibility = false;
|
||||
filter_table_offset = TABLE_OFFSET_INVALID;
|
||||
cryptomatte_passes = CRYPT_NONE;
|
||||
|
|
Loading…
Reference in New Issue