[Bf-blender-cvs] [5260aaf3b1c] master: Fix T73921: Eevee volume render test memory leak in Mantaflow

Sebastián Barschkis noreply at git.blender.org
Sat Mar 14 00:34:46 CET 2020


Commit: 5260aaf3b1c87f5595dff411d9f6307f1eb6c44e
Author: Sebastián Barschkis
Date:   Sat Mar 14 00:30:55 2020 +0100
Branches: master
https://developer.blender.org/rB5260aaf3b1c87f5595dff411d9f6307f1eb6c44e

Fix T73921: Eevee volume render test memory leak in Mantaflow

Fixed memory leak that showed up after the original issue (crash) had been fixed in 93ac4709ebe8. The fix ensures that light cache bakes free up GPU smoke textures and the smoke domain list correctly.

This commit also removes the workaround (f3a33a92987f) that disabled light cache bakes for fluid objects.

===================================================================

M	source/blender/draw/engines/eevee/eevee_lightcache.c
M	source/blender/draw/engines/eevee/eevee_volumes.c
M	tests/python/eevee_render_tests.py

===================================================================

diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c
index 35a45cc97f4..9447c365c48 100644
--- a/source/blender/draw/engines/eevee/eevee_lightcache.c
+++ b/source/blender/draw/engines/eevee/eevee_lightcache.c
@@ -777,6 +777,8 @@ static void eevee_lightbake_delete_resources(EEVEE_LightBake *lbake)
   if (!lbake->resource_only) {
     BLI_mutex_unlock(lbake->mutex);
   }
+
+  EEVEE_volumes_free_smoke_textures();
 }
 
 /* Cache as in draw cache not light cache. */
diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c
index 8c1c72a3c20..41f8dddf0fb 100644
--- a/source/blender/draw/engines/eevee/eevee_volumes.c
+++ b/source/blender/draw/engines/eevee/eevee_volumes.c
@@ -178,8 +178,6 @@ void EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
 
   const float *viewport_size = DRW_viewport_size_get();
 
-  BLI_listbase_clear(&e_data.smoke_domains);
-
   const int tile_size = scene_eval->eevee.volumetric_tile_size;
 
   /* Find Froxel Texture resolution. */
diff --git a/tests/python/eevee_render_tests.py b/tests/python/eevee_render_tests.py
index 0d9fd37b0d7..a7130136d0a 100755
--- a/tests/python/eevee_render_tests.py
+++ b/tests/python/eevee_render_tests.py
@@ -35,13 +35,6 @@ def setup():
         # mat.use_screen_refraction = True
         mat.use_sss_translucency = True
 
-    # Workaround for crash with Mantaflow (T73921).
-    use_light_cache_bake = True
-    for ob in bpy.data.objects:
-        for mod in ob.modifiers:
-            if mod.type == 'FLUID':
-                use_light_cache_bake = False
-
     cubemap = None
     grid = None
     # Does not work in edit mode
@@ -86,8 +79,7 @@ def setup():
     eevee.gi_visibility_resolution = '16'
     eevee.gi_irradiance_smoothing = 0
 
-    if use_light_cache_bake:
-        bpy.ops.scene.light_cache_bake()
+    bpy.ops.scene.light_cache_bake()
 
 
 # When run from inside Blender, render and exit.



More information about the Bf-blender-cvs mailing list