Page MenuHome

Fix Memory Leak introduced by Draw Manager Threading
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Jun 9 2020, 4:24 PM.

Details

Summary

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.

Diff Detail

Repository
rB Blender

Event Timeline

Jeroen Bakker (jbakker) requested review of this revision.Jun 9 2020, 4:24 PM
Jeroen Bakker (jbakker) retitled this revision from [WIP] Fix T77496: Delayed Mesh Extraction to [WIP] Fix Memory Leak introduced by Draw Manager Threading.Jun 12 2020, 9:24 AM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)

Fixed failing code paths. DRW_render_instance_buffer_finish must be ordered after drw_task_graph_deinit as the vert buffers could not have been created yet

Jeroen Bakker (jbakker) retitled this revision from [WIP] Fix Memory Leak introduced by Draw Manager Threading to Fix Memory Leak introduced by Draw Manager Threading.Jun 12 2020, 11:48 AM
This revision is now accepted and ready to land.Jun 15 2020, 2:57 PM