Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jbakker>2020-06-15 16:22:40 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2020-06-15 16:22:57 +0300
commit3c717a631b56244f4a6c6dc30e8c353f318b35fe (patch)
tree2e014da09bcec7e02059c50b768a36ab57e7d633 /source/blender/draw/intern/draw_cache.c
parentec25084f5a404cbca4ceffd659d46b21c758522a (diff)
Fix Memory Leak introduced by Draw Manager Threading
The memory leak is noticeable when using custom bone shapes. When using custom bone shapes objects could be extracted twice. Where the second extraction can overwrite data created by the first extraction what causes the memory leak. Options that have been checked: 1. Use two task graphs phases. One for normal extraction (DST.task_graph) and the other one will handle extractions that require blocking threads. 2. Keep a list of all objects that needs extraction and only start extraction when all objects have been populated. The second would slow performance as the extraction only happens when all objects have been populated. In the future we might want to go for the second option when we have the capability to render multiple viewports with a single populate. As this design isn't clear this patch will implement the first option. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D7969
Diffstat (limited to 'source/blender/draw/intern/draw_cache.c')
-rw-r--r--source/blender/draw/intern/draw_cache.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c
index c23ea3d7c82..af5b9cd05dd 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -3552,6 +3552,11 @@ void drw_batch_cache_generate_requested(Object *ob)
}
}
+void drw_batch_cache_generate_requested_delayed(Object *ob)
+{
+ BLI_gset_add(DST.delayed_extraction, ob);
+}
+
void DRW_batch_cache_free_old(Object *ob, int ctime)
{
struct Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob);