Fix #70114: Cycles: Particle systems missing in headless multiview render #120543

Merged
Lukas Stockner merged 1 commits from LukasStockner/blender:fix-instance-cache into main 2024-04-15 17:41:05 +02:00
3 changed files with 13 additions and 9 deletions

View File

@ -406,15 +406,21 @@ void BlenderSession::render(BL::Depsgraph &b_depsgraph_)
height,
&python_thread_state,
session_params.device);
/* At the moment we only free if we are not doing multi-view
* (or if we are rendering the last view). See #58142/D4239 for discussion.
*/
const bool can_free_cache = (view_index == num_views - 1);
if (can_free_cache) {
sync->free_data_after_sync(b_depsgraph);
}
builtin_images_load();
/* Attempt to free all data which is held by Blender side, since at this
* point we know that we've got everything to render current view layer.
*/
/* At the moment we only free if we are not doing multi-view
* (or if we are rendering the last view). See #58142/D4239 for discussion.
*/
if (view_index == num_views - 1) {
if (can_free_cache) {
free_blender_memory_if_possible();
}

View File

@ -294,8 +294,6 @@ void BlenderSync::sync_data(BL::RenderSettings &b_render,
* false = don't delete unused shaders, not supported. */
shader_map.post_sync(false);
free_data_after_sync(b_depsgraph);
VLOG_INFO << "Total time spent synchronizing data: " << timer.get_time();
has_updates_ = false;

View File

@ -87,6 +87,9 @@ class BlenderSync {
return view_layer.bound_samples;
}
/* Early data free. */
void free_data_after_sync(BL::Depsgraph &b_depsgraph);
/* get parameters */
static SceneParams get_scene_params(BL::Scene &b_scene,
const bool background,
@ -208,9 +211,6 @@ class BlenderSync {
/* Images. */
void sync_images();
/* Early data free. */
void free_data_after_sync(BL::Depsgraph &b_depsgraph);
/* util */
void find_shader(BL::ID &id, array<Node *> &used_shaders, Shader *default_shader);
bool BKE_object_is_modified(BL::Object &b_ob);