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
path: root/source
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2019-12-05 10:14:32 +0300
committerJeroen Bakker <jeroen@blender.org>2019-12-05 10:14:32 +0300
commitf4b7d57551061350216048d5d30b9b674f741c28 (patch)
tree4702dbcf3704631b5750479ad8fffc64b1c29627 /source
parent722b8e4692829b11b9ae150cb9daccd52d25a2e7 (diff)
Fix T72175: DrawManager Crash Large Objects
Introduced by 9c337fcfe2a4 mistaken that `MeshExtract.use_threading` set to false means that no threading is used at all. This is not the case it will still perform threading for large objects, it will only run the different subtasks in serial. Fixed by scheduling the `lines_loose` in the task_pool after the rest have been executed. This is cleaner than the previous implementation as it sticks more to the actual design.
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/intern/draw_cache_extract_mesh.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c b/source/blender/draw/intern/draw_cache_extract_mesh.c
index 06c2bfc301a..7d0cb7c7076 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh.c
+++ b/source/blender/draw/intern/draw_cache_extract_mesh.c
@@ -4483,20 +4483,22 @@ void mesh_buffer_cache_create_requested(MeshBatchCache *cache,
EXTRACT(ibo, edituv_points);
EXTRACT(ibo, edituv_fdots);
-#undef EXTRACT
-
/* TODO(fclem) Ideally, we should have one global pool for all
* objects and wait for finish only before drawing when buffers
* need to be ready. */
BLI_task_pool_work_and_wait(task_pool);
- BLI_task_pool_free(task_pool);
+
+ /* The next task(s) rely on the result of the tasks above. */
/* The `lines_loose` is a sub buffer from `ibo.lines`.
- * We don't use the extract mechanism due to potential synchronization issues.*/
- if (mbc.ibo.lines_loose) {
- extract_task_create(NULL, mr, &extract_lines_loose, mbc.ibo.lines_loose, task_counters);
- }
+ * We schedule it here due to potential synchronization issues.*/
+ EXTRACT(ibo, lines_loose);
+ BLI_task_pool_work_and_wait(task_pool);
+
+#undef EXTRACT
+
+ BLI_task_pool_free(task_pool);
MEM_freeN(task_counters);
mesh_render_data_free(mr);