Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
| Show First 20 Lines • Show All 476 Lines • ▼ Show 20 Lines | static void lineart_main_occlusion_begin(LineartRenderBuffer *rb) | ||||
| /* The "last" entry is used to store worker progress in the whole list. | /* The "last" entry is used to store worker progress in the whole list. | ||||
| * These list themselves are single-direction linked, with list.first being the head. */ | * These list themselves are single-direction linked, with list.first being the head. */ | ||||
| rb->contour.last = rb->contour.first; | rb->contour.last = rb->contour.first; | ||||
| rb->crease.last = rb->crease.first; | rb->crease.last = rb->crease.first; | ||||
| rb->intersection.last = rb->intersection.first; | rb->intersection.last = rb->intersection.first; | ||||
| rb->material.last = rb->material.first; | rb->material.last = rb->material.first; | ||||
| rb->edge_mark.last = rb->edge_mark.first; | rb->edge_mark.last = rb->edge_mark.first; | ||||
| TaskPool *tp = BLI_task_pool_create(NULL, TASK_PRIORITY_HIGH); | TaskPool *tp = BLI_task_pool_create(NULL, TASK_PRIORITY_HIGH, TASK_ISOLATION_ON); | ||||
| for (i = 0; i < thread_count; i++) { | for (i = 0; i < thread_count; i++) { | ||||
| rti[i].thread_id = i; | rti[i].thread_id = i; | ||||
| rti[i].rb = rb; | rti[i].rb = rb; | ||||
| BLI_task_pool_push(tp, (TaskRunFunction)lineart_occlusion_worker, &rti[i], 0, NULL); | BLI_task_pool_push(tp, (TaskRunFunction)lineart_occlusion_worker, &rti[i], 0, NULL); | ||||
| } | } | ||||
| BLI_task_pool_work_and_wait(tp); | BLI_task_pool_work_and_wait(tp); | ||||
| BLI_task_pool_free(tp); | BLI_task_pool_free(tp); | ||||
| ▲ Show 20 Lines • Show All 1,488 Lines • ▼ Show 20 Lines | DEG_OBJECT_ITER_BEGIN (depsgraph, ob, flags) { | ||||
| copy_m4d_m4(obi->normal, imat); | copy_m4d_m4(obi->normal, imat); | ||||
| obi->original_me = use_mesh; | obi->original_me = use_mesh; | ||||
| obi->original_ob = (ob->id.orig_id ? (Object *)ob->id.orig_id : (Object *)ob); | obi->original_ob = (ob->id.orig_id ? (Object *)ob->id.orig_id : (Object *)ob); | ||||
| lineart_geometry_load_assign_thread(olti, obi, thread_count, use_mesh->totpoly); | lineart_geometry_load_assign_thread(olti, obi, thread_count, use_mesh->totpoly); | ||||
| } | } | ||||
| DEG_OBJECT_ITER_END; | DEG_OBJECT_ITER_END; | ||||
| TaskPool *tp = BLI_task_pool_create(NULL, TASK_PRIORITY_HIGH); | TaskPool *tp = BLI_task_pool_create(NULL, TASK_PRIORITY_HIGH, TASK_ISOLATION_ON); | ||||
| for (int i = 0; i < thread_count; i++) { | for (int i = 0; i < thread_count; i++) { | ||||
| olti[i].rb = rb; | olti[i].rb = rb; | ||||
| olti[i].dg = depsgraph; | olti[i].dg = depsgraph; | ||||
| BLI_task_pool_push(tp, (TaskRunFunction)lineart_object_load_worker, &olti[i], 0, NULL); | BLI_task_pool_push(tp, (TaskRunFunction)lineart_object_load_worker, &olti[i], 0, NULL); | ||||
| } | } | ||||
| BLI_task_pool_work_and_wait(tp); | BLI_task_pool_work_and_wait(tp); | ||||
| BLI_task_pool_free(tp); | BLI_task_pool_free(tp); | ||||
| ▲ Show 20 Lines • Show All 2,178 Lines • Show Last 20 Lines | |||||