diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_ocean.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_ocean.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c index 189cfb8553e..fcf1874b407 100644 --- a/source/blender/modifiers/intern/MOD_ocean.c +++ b/source/blender/modifiers/intern/MOD_ocean.c @@ -261,7 +261,8 @@ typedef struct GenerateOceanGeometryData { float ix, iy; } GenerateOceanGeometryData; -static void generate_ocean_geometry_vertices(void *userdata, const int y) +static void generate_ocean_geometry_vertices(void *userdata, const int y, + const ParallelRangeTLS *UNUSED(tls)) { GenerateOceanGeometryData *gogd = userdata; int x; @@ -275,7 +276,8 @@ static void generate_ocean_geometry_vertices(void *userdata, const int y) } } -static void generate_ocean_geometry_polygons(void *userdata, const int y) +static void generate_ocean_geometry_polygons(void *userdata, const int y, + const ParallelRangeTLS *UNUSED(tls)) { GenerateOceanGeometryData *gogd = userdata; int x; @@ -305,7 +307,8 @@ static void generate_ocean_geometry_polygons(void *userdata, const int y) } } -static void generate_ocean_geometry_uvs(void *userdata, const int y) +static void generate_ocean_geometry_uvs(void *userdata, const int y, + const ParallelRangeTLS *UNUSED(tls)) { GenerateOceanGeometryData *gogd = userdata; int x; @@ -367,11 +370,15 @@ static DerivedMesh *generate_ocean_geometry(OceanModifierData *omd) gogd.origindex = CustomData_get_layer(&result->polyData, CD_ORIGINDEX); + ParallelRangeSettings settings; + BLI_parallel_range_settings_defaults(&settings); + settings.use_threading = use_threading; + /* create vertices */ - BLI_task_parallel_range(0, gogd.res_y + 1, &gogd, generate_ocean_geometry_vertices, use_threading); + BLI_task_parallel_range(0, gogd.res_y + 1, &gogd, generate_ocean_geometry_vertices, &settings); /* create faces */ - BLI_task_parallel_range(0, gogd.res_y, &gogd, generate_ocean_geometry_polygons, use_threading); + BLI_task_parallel_range(0, gogd.res_y, &gogd, generate_ocean_geometry_polygons, &settings); CDDM_calc_edges(result); @@ -383,7 +390,7 @@ static DerivedMesh *generate_ocean_geometry(OceanModifierData *omd) gogd.ix = 1.0 / gogd.rx; gogd.iy = 1.0 / gogd.ry; - BLI_task_parallel_range(0, gogd.res_y, &gogd, generate_ocean_geometry_uvs, use_threading); + BLI_task_parallel_range(0, gogd.res_y, &gogd, generate_ocean_geometry_uvs, &settings); } } |