diff options
author | Jeroen Bakker <jbakker> | 2020-06-15 16:22:40 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2020-06-15 16:22:57 +0300 |
commit | 3c717a631b56244f4a6c6dc30e8c353f318b35fe (patch) | |
tree | 2e014da09bcec7e02059c50b768a36ab57e7d633 /source/blender/draw/intern/draw_manager.h | |
parent | ec25084f5a404cbca4ceffd659d46b21c758522a (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_manager.h')
-rw-r--r-- | source/blender/draw/intern/draw_manager.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h index 6cae2a4f9f6..31a2dd7f0fe 100644 --- a/source/blender/draw/intern/draw_manager.h +++ b/source/blender/draw/intern/draw_manager.h @@ -548,6 +548,8 @@ typedef struct DRWManager { #endif struct TaskGraph *task_graph; + /* Contains list of objects that needs to be extracted from other objects. */ + struct GSet *delayed_extraction; /* ---------- Nothing after this point is cleared after use ----------- */ @@ -585,6 +587,7 @@ eDRWCommandType command_type_get(uint64_t *command_type_bits, int index); void drw_batch_cache_validate(Object *ob); void drw_batch_cache_generate_requested(struct Object *ob); +void drw_batch_cache_generate_requested_delayed(Object *ob); void drw_resource_buffer_finish(ViewportMemoryPool *vmempool); |