diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2021-01-22 17:01:26 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2021-01-22 18:08:25 +0300 |
commit | bbe6d44928235cd4a5cfbeaf1a1de78ed861bb92 (patch) | |
tree | c3a8653dfdf38029caebfd9978ea4644535bae3d /intern/cycles/blender/blender_sync.cpp | |
parent | 131a758b6f88a2be816e9351d216bcfb9c965c4b (diff) |
Cycles: optimize device updates
This optimizes device updates (during user edits or frame changes in
the viewport) by avoiding unnecessary computations. To achieve this,
we use a combination of the sockets' update flags as well as some new
flags passed to the various managers when tagging for an update to tell
exactly what the tagging is for (e.g. shader was modified, object was
removed, etc.).
Besides avoiding recomputations, we also avoid resending to the devices
unmodified data arrays, thus reducing bandwidth usage. For OptiX and
Embree, BVH packing was also multithreaded.
The performance improvements may vary depending on the used device (CPU
or GPU), and the content of the scene. Simple scenes (e.g. with no adaptive
subdivision or volumes) rendered using OptiX will benefit from this work
the most.
On average, for a variety of animated scenes, this gives a 3x speedup.
Reviewed By: #cycles, brecht
Maniphest Tasks: T79174
Differential Revision: https://developer.blender.org/D9555
Diffstat (limited to 'intern/cycles/blender/blender_sync.cpp')
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index e27daa2488d..6b2039e7e21 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -302,11 +302,6 @@ void BlenderSync::sync_integrator() integrator->set_sample_clamp_direct(get_float(cscene, "sample_clamp_direct")); integrator->set_sample_clamp_indirect(get_float(cscene, "sample_clamp_indirect")); if (!preview) { - if (integrator->get_motion_blur() != r.use_motion_blur()) { - scene->object_manager->tag_update(scene); - scene->camera->tag_modified(); - } - integrator->set_motion_blur(r.use_motion_blur()); } @@ -375,8 +370,8 @@ void BlenderSync::sync_integrator() integrator->set_ao_bounces(0); } - if (integrator->is_modified()) - integrator->tag_update(scene); + /* UPDATE_NONE as we don't want to tag the integrator as modified, just tag dependent things */ + integrator->tag_update(scene, Integrator::UPDATE_NONE); } /* Film */ @@ -729,7 +724,7 @@ vector<Pass> BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, scene->film->set_pass_alpha_threshold(b_view_layer.pass_alpha_threshold()); scene->film->tag_passes_update(scene, passes); - scene->integrator->tag_update(scene); + scene->integrator->tag_update(scene, Integrator::UPDATE_ALL); return passes; } |