diff options
author | Jeroen Bakker <jbakker> | 2021-05-31 18:11:01 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-05-31 18:11:25 +0300 |
commit | 44d2479dc36fe3409afc660eea369bea8a517987 (patch) | |
tree | 6f22a9983ca211c6759c352b8ff2ccd946e7dc23 /source/blender/draw/intern/draw_cache_impl_mesh.c | |
parent | aebeb85fe013a671f71f47d6f210c192598f408f (diff) |
Refactor: DRW Mesh Extractor: Join the extractors in a same loop
This patch replaces / redoes the entire MeshExtractors system.
Although they were useful and facilitated the addition of new buffers, they made it difficult to control the threads and added a lot of threading overhead.
Part of the problem was in traversing the same loop type in different threads. The concurrent access of the BMesh Elements slowed the reading.
This patch simplifies the use of threads by merging all the old callbacks from the extracts into a single series of iteration functions.
The type of extraction can be chosen using flags.
This optimized the process by around 34%.
Initial idea and implementation By @mano-wii.
Fine-tuning, cleanup by @atmind.
MASTER:
large_mesh_editing:
- rdata 9ms iter 50ms (frame 155ms)
- Average: 6.462874 FPS
PATCH:
large_mesh_editing:
- rdata 9ms iter 34ms (frame 136ms)
- Average: 7.379491 FPS
Differential Revision: https://developer.blender.org/D11425
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_mesh.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_mesh.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index c2dc9b3ad8d..0d91432d4e5 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -1559,7 +1559,7 @@ void DRW_mesh_batch_cache_create_requested(struct TaskGraph *task_graph, if (do_uvcage) { mesh_buffer_cache_create_requested(task_graph, cache, - cache->uv_cage, + &cache->uv_cage, &cache->uv_cage_extraction_cache, me, is_editmode, @@ -1578,7 +1578,7 @@ void DRW_mesh_batch_cache_create_requested(struct TaskGraph *task_graph, if (do_cage) { mesh_buffer_cache_create_requested(task_graph, cache, - cache->cage, + &cache->cage, &cache->cage_extraction_cache, me, is_editmode, @@ -1596,7 +1596,7 @@ void DRW_mesh_batch_cache_create_requested(struct TaskGraph *task_graph, mesh_buffer_cache_create_requested(task_graph, cache, - cache->final, + &cache->final, &cache->final_extraction_cache, me, is_editmode, |