diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-18 18:35:59 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-18 18:35:59 +0300 |
commit | 7016f11d92f0f4160131f051aa53eb131890a778 (patch) | |
tree | cc0baf32f62e4c4ab013a5d569f74343c6e11ce9 /source/blender/blenkernel/intern/subdiv_ccg.c | |
parent | 9bf3e0299b18d65cf0da77a7a0a8a907055a3328 (diff) |
Subdiv: CCG, make inner face grids averaging more reusable
Diffstat (limited to 'source/blender/blenkernel/intern/subdiv_ccg.c')
-rw-r--r-- | source/blender/blenkernel/intern/subdiv_ccg.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/subdiv_ccg.c b/source/blender/blenkernel/intern/subdiv_ccg.c index c6554203cf8..bd8ccda789b 100644 --- a/source/blender/blenkernel/intern/subdiv_ccg.c +++ b/source/blender/blenkernel/intern/subdiv_ccg.c @@ -607,17 +607,12 @@ static void average_grid_element(SubdivCCG *subdiv_ccg, } } -static void subdiv_ccg_average_inner_grids_task( - void *__restrict userdata_v, - const int face_index, - const ParallelRangeTLS *__restrict UNUSED(tls_v)) +static void subdiv_ccg_average_inner_face_grids( + SubdivCCG *subdiv_ccg, + CCGKey *key, + SubdivCCGFace *face) { - AverageInnerGridsData *data = userdata_v; - SubdivCCG *subdiv_ccg = data->subdiv_ccg; - CCGKey *key = data->key; CCGElem **grids = subdiv_ccg->grids; - SubdivCCGFace *faces = subdiv_ccg->faces; - SubdivCCGFace *face = &faces[face_index]; const int num_face_grids = face->num_grids; const int grid_size = subdiv_ccg->grid_size; CCGElem *prev_grid = grids[face->start_grid_index + num_face_grids - 1]; @@ -631,6 +626,20 @@ static void subdiv_ccg_average_inner_grids_task( } prev_grid = grid; } + +} + +static void subdiv_ccg_average_inner_grids_task( + void *__restrict userdata_v, + const int face_index, + const ParallelRangeTLS *__restrict UNUSED(tls_v)) +{ + AverageInnerGridsData *data = userdata_v; + SubdivCCG *subdiv_ccg = data->subdiv_ccg; + CCGKey *key = data->key; + SubdivCCGFace *faces = subdiv_ccg->faces; + SubdivCCGFace *face = &faces[face_index]; + subdiv_ccg_average_inner_face_grids(subdiv_ccg, key, face); } void BKE_subdiv_ccg_average_grids(SubdivCCG *subdiv_ccg) |