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
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c8
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_2d.c3
-rw-r--r--source/blender/editors/sculpt_paint/paint_mask.c9
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c18
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c97
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c3
6 files changed, 74 insertions, 64 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index f0d9a0bbb68..1378952c4cc 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -151,7 +151,7 @@ typedef struct LoadTexData {
float radius;
} LoadTexData;
-static void load_tex_task_cb_ex(void *userdata, void *UNUSED(userdata_chunck), const int j, const int thread_id)
+static void load_tex_task_cb_ex(void *userdata, const int j, const ParallelRangeTLS *tls)
{
LoadTexData *data = userdata;
Brush *br = data->br;
@@ -212,7 +212,7 @@ static void load_tex_task_cb_ex(void *userdata, void *UNUSED(userdata_chunck), c
if (col) {
float rgba[4];
- paint_get_tex_pixel_col(mtex, x, y, rgba, pool, thread_id, convert_to_linear, colorspace);
+ paint_get_tex_pixel_col(mtex, x, y, rgba, pool, tls->thread_id, convert_to_linear, colorspace);
buffer[index * 4] = rgba[0] * 255;
buffer[index * 4 + 1] = rgba[1] * 255;
@@ -220,7 +220,7 @@ static void load_tex_task_cb_ex(void *userdata, void *UNUSED(userdata_chunck), c
buffer[index * 4 + 3] = rgba[3] * 255;
}
else {
- float avg = paint_get_tex_pixel(mtex, x, y, pool, thread_id);
+ float avg = paint_get_tex_pixel(mtex, x, y, pool, tls->thread_id);
avg += br->texture_sample_bias;
@@ -367,7 +367,7 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
return 1;
}
-static void load_tex_cursor_task_cb(void *userdata, const int j)
+static void load_tex_cursor_task_cb(void *userdata, const int j, const ParallelRangeTLS *UNUSED(tls))
{
LoadTexData *data = userdata;
Brush *br = data->br;
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index a1aad2bdc57..b687c937a22 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -1070,7 +1070,8 @@ typedef struct Paint2DForeachData {
int tilew;
} Paint2DForeachData;
-static void paint_2d_op_foreach_do(void *data_v, const int iter)
+static void paint_2d_op_foreach_do(void *data_v, const int iter,
+ const ParallelRangeTLS *UNUSED(tls))
{
Paint2DForeachData *data = (Paint2DForeachData *)data_v;
paint_2d_do_making_brush(data->s, data->region, data->curveb,
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c
index 3b1b993a3e3..a48a3666ef9 100644
--- a/source/blender/editors/sculpt_paint/paint_mask.c
+++ b/source/blender/editors/sculpt_paint/paint_mask.c
@@ -104,7 +104,8 @@ typedef struct MaskTaskData {
float (*clip_planes_final)[4];
} MaskTaskData;
-static void mask_flood_fill_task_cb(void *userdata, const int i)
+static void mask_flood_fill_task_cb(void *userdata, const int i,
+ const ParallelRangeTLS *UNUSED(tls))
{
MaskTaskData *data = userdata;
@@ -218,7 +219,8 @@ static void flip_plane(float out[4], const float in[4], const char symm)
out[3] = in[3];
}
-static void mask_box_select_task_cb(void *userdata, const int i)
+static void mask_box_select_task_cb(void *userdata, const int i,
+ const ParallelRangeTLS *UNUSED(tls))
{
MaskTaskData *data = userdata;
@@ -373,7 +375,8 @@ static void mask_lasso_px_cb(int x, int x_end, int y, void *user_data)
} while (++index != index_end);
}
-static void mask_gesture_lasso_task_cb(void *userdata, const int i)
+static void mask_gesture_lasso_task_cb(void *userdata, const int i,
+ const ParallelRangeTLS *UNUSED(tls))
{
LassoMaskData *lasso_data = userdata;
MaskTaskData *data = &lasso_data->task_data;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index d61777a6d12..666272bd11a 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1431,7 +1431,7 @@ static float wpaint_get_active_weight(const MDeformVert *dv, const WeightPaintIn
}
static void do_wpaint_precompute_weight_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int UNUSED(thread_id))
+ void *userdata, const int n, const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
const MDeformVert *dv = &data->me->dvert[n];
@@ -1458,7 +1458,7 @@ static void precompute_weight_values(
}
static void do_wpaint_brush_blur_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int UNUSED(thread_id))
+ void *userdata, const int n, const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -1547,7 +1547,7 @@ static void do_wpaint_brush_blur_task_cb_ex(
}
static void do_wpaint_brush_smear_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int UNUSED(thread_id))
+ void *userdata, const int n, const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -1654,7 +1654,7 @@ static void do_wpaint_brush_smear_task_cb_ex(
}
static void do_wpaint_brush_draw_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int UNUSED(thread_id))
+ void *userdata, const int n, const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -1724,7 +1724,7 @@ static void do_wpaint_brush_draw_task_cb_ex(
}
static void do_wpaint_brush_calc_average_weight_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int UNUSED(thread_id))
+ void *userdata, const int n, const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2377,7 +2377,7 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f
}
static void do_vpaint_brush_calc_average_color_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int UNUSED(thread_id))
+ void *userdata, const int n, const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2439,7 +2439,7 @@ static float tex_color_alpha_ubyte(
}
static void do_vpaint_brush_draw_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int UNUSED(thread_id))
+ void *userdata, const int n, const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2531,7 +2531,7 @@ static void do_vpaint_brush_draw_task_cb_ex(
}
static void do_vpaint_brush_blur_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int UNUSED(thread_id))
+ void *userdata, const int n, const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2640,7 +2640,7 @@ static void do_vpaint_brush_blur_task_cb_ex(
}
static void do_vpaint_brush_smear_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int UNUSED(thread_id))
+ void *userdata, const int n, const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 53d7684e331..4684395c18d 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -376,7 +376,8 @@ static bool sculpt_stroke_is_dynamic_topology(
/*** paint mesh ***/
-static void paint_mesh_restore_co_task_cb(void *userdata, const int n)
+static void paint_mesh_restore_co_task_cb(void *userdata, const int n,
+ const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -794,7 +795,8 @@ static float calc_symmetry_feather(Sculpt *sd, StrokeCache *cache)
* \note These are all _very_ similar, when changing one, check others.
* \{ */
-static void calc_area_normal_and_center_task_cb(void *userdata, const int n)
+static void calc_area_normal_and_center_task_cb(void *userdata, const int n,
+ const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -1626,7 +1628,7 @@ typedef struct {
} SculptFindNearestToRayData;
static void do_smooth_brush_mesh_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -1648,7 +1650,7 @@ static void do_smooth_brush_mesh_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, vd.co)) {
const float fade = bstrength * tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, smooth_mask ? 0.0f : (vd.mask ? *vd.mask : 0.0f), thread_id);
+ vd.no, vd.fno, smooth_mask ? 0.0f : (vd.mask ? *vd.mask : 0.0f), tls->thread_id);
if (smooth_mask) {
float val = neighbor_average_mask(ss, vd.vert_indices[vd.i]) - *vd.mask;
val *= fade * bstrength;
@@ -1674,7 +1676,7 @@ static void do_smooth_brush_mesh_task_cb_ex(
}
static void do_smooth_brush_bmesh_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -1696,7 +1698,7 @@ static void do_smooth_brush_bmesh_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, vd.co)) {
const float fade = bstrength * tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, smooth_mask ? 0.0f : *vd.mask, thread_id);
+ vd.no, vd.fno, smooth_mask ? 0.0f : *vd.mask, tls->thread_id);
if (smooth_mask) {
float val = bmesh_neighbor_average_mask(vd.bm_vert, vd.cd_vert_mask_offset) - *vd.mask;
val *= fade * bstrength;
@@ -1722,10 +1724,10 @@ static void do_smooth_brush_bmesh_task_cb_ex(
}
static void do_smooth_brush_multires_task_cb_ex(
- void *userdata, void *userdata_chunk, const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
- SculptDoBrushSmoothGridDataChunk *data_chunk = userdata_chunk;
+ SculptDoBrushSmoothGridDataChunk *data_chunk = tls->userdata_chunk;
SculptSession *ss = data->ob->sculpt;
Sculpt *sd = data->sd;
const Brush *brush = data->brush;
@@ -1837,7 +1839,7 @@ static void do_smooth_brush_multires_task_cb_ex(
const float strength_mask = (smooth_mask ? 0.0f : *mask);
const float fade = bstrength * tex_strength(
ss, brush, co, sqrtf(test.dist),
- NULL, fno, strength_mask, thread_id);
+ NULL, fno, strength_mask, tls->thread_id);
float f = 1.0f / 16.0f;
if (x == 0 || x == gridsize - 1)
@@ -1940,7 +1942,7 @@ static void do_smooth_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
}
static void do_mask_brush_draw_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -1958,7 +1960,7 @@ static void do_mask_brush_draw_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, vd.co)) {
const float fade = tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, 0.0f, thread_id);
+ vd.no, vd.fno, 0.0f, tls->thread_id);
(*vd.mask) += fade * bstrength;
CLAMP(*vd.mask, 0, 1);
@@ -2000,7 +2002,7 @@ static void do_mask_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
}
static void do_draw_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2022,7 +2024,7 @@ static void do_draw_brush_task_cb_ex(
/* offset vertex */
const float fade = tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
+ vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
mul_v3_v3fl(proxy[vd.i], offset, fade);
@@ -2060,7 +2062,7 @@ static void do_draw_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
* Used for 'SCULPT_TOOL_CREASE' and 'SCULPT_TOOL_BLOB'
*/
static void do_crease_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2084,7 +2086,7 @@ static void do_crease_brush_task_cb_ex(
/* offset vertex */
const float fade = tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
+ vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
float val1[3];
float val2[3];
@@ -2154,7 +2156,7 @@ static void do_crease_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
}
static void do_pinch_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2175,7 +2177,7 @@ static void do_pinch_brush_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, vd.co)) {
const float fade = bstrength * tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
+ vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
float val[3];
sub_v3_v3v3(val, test.location, vd.co);
@@ -2205,7 +2207,7 @@ static void do_pinch_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
}
static void do_grab_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2232,7 +2234,7 @@ static void do_grab_brush_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, orig_data.co)) {
const float fade = bstrength * tex_strength(
ss, brush, orig_data.co, sqrtf(test.dist),
- orig_data.no, NULL, vd.mask ? *vd.mask : 0.0f, thread_id);
+ orig_data.no, NULL, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
@@ -2266,7 +2268,7 @@ static void do_grab_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
}
static void do_nudge_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2288,7 +2290,7 @@ static void do_nudge_brush_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, vd.co)) {
const float fade = bstrength * tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
+ vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
mul_v3_v3fl(proxy[vd.i], cono, fade);
@@ -2322,7 +2324,7 @@ static void do_nudge_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
}
static void do_snake_hook_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2349,7 +2351,7 @@ static void do_snake_hook_brush_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, vd.co)) {
const float fade = bstrength * tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
+ vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
@@ -2428,7 +2430,7 @@ static void do_snake_hook_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
}
static void do_thumb_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2455,7 +2457,7 @@ static void do_thumb_brush_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, orig_data.co)) {
const float fade = bstrength * tex_strength(
ss, brush, orig_data.co, sqrtf(test.dist),
- orig_data.no, NULL, vd.mask ? *vd.mask : 0.0f, thread_id);
+ orig_data.no, NULL, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
mul_v3_v3fl(proxy[vd.i], cono, fade);
@@ -2489,7 +2491,7 @@ static void do_thumb_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
}
static void do_rotate_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2517,7 +2519,7 @@ static void do_rotate_brush_task_cb_ex(
float vec[3], rot[3][3];
const float fade = bstrength * tex_strength(
ss, brush, orig_data.co, sqrtf(test.dist),
- orig_data.no, NULL, vd.mask ? *vd.mask : 0.0f, thread_id);
+ orig_data.no, NULL, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
sub_v3_v3v3(vec, orig_data.co, ss->cache->location);
axis_angle_normalized_to_mat3(rot, ss->cache->sculpt_normal_symm, angle * fade);
@@ -2551,7 +2553,7 @@ static void do_rotate_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
}
static void do_layer_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2585,7 +2587,7 @@ static void do_layer_brush_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, orig_data.co)) {
const float fade = bstrength * tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
+ vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
float *disp = &layer_disp[vd.i];
float val[3];
@@ -2638,7 +2640,7 @@ static void do_layer_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
}
static void do_inflate_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2659,7 +2661,7 @@ static void do_inflate_brush_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, vd.co)) {
const float fade = bstrength * tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
+ vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
float val[3];
if (vd.fno)
@@ -2802,7 +2804,7 @@ static float get_offset(Sculpt *sd, SculptSession *ss)
}
static void do_flatten_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2835,7 +2837,7 @@ static void do_flatten_brush_task_cb_ex(
if (plane_trim(ss->cache, brush, val)) {
const float fade = bstrength * tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
+ vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
mul_v3_v3fl(proxy[vd.i], val, fade);
@@ -2880,7 +2882,7 @@ static void do_flatten_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totno
}
static void do_clay_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -2917,7 +2919,7 @@ static void do_clay_brush_task_cb_ex(
* causes glitch with planes, see: T44390 */
const float fade = bstrength * tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
+ vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
mul_v3_v3fl(proxy[vd.i], val, fade);
@@ -2966,7 +2968,7 @@ static void do_clay_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
}
static void do_clay_strips_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -3002,7 +3004,7 @@ static void do_clay_strips_brush_task_cb_ex(
* causes glitch with planes, see: T44390 */
const float fade = bstrength * tex_strength(
ss, brush, vd.co, ss->cache->radius * test.dist,
- vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
+ vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
mul_v3_v3fl(proxy[vd.i], val, fade);
@@ -3076,7 +3078,7 @@ static void do_clay_strips_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int t
}
static void do_fill_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -3110,7 +3112,7 @@ static void do_fill_brush_task_cb_ex(
if (plane_trim(ss->cache, brush, val)) {
const float fade = bstrength * tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
+ vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
mul_v3_v3fl(proxy[vd.i], val, fade);
@@ -3157,7 +3159,7 @@ static void do_fill_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
}
static void do_scrape_brush_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -3190,7 +3192,7 @@ static void do_scrape_brush_task_cb_ex(
if (plane_trim(ss->cache, brush, val)) {
const float fade = bstrength * tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
+ vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
mul_v3_v3fl(proxy[vd.i], val, fade);
@@ -3237,7 +3239,7 @@ static void do_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod
}
static void do_gravity_task_cb_ex(
- void *userdata, void *UNUSED(userdata_chunk), const int n, const int thread_id)
+ void *userdata, const int n, const ParallelRangeTLS *tls)
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -3257,7 +3259,7 @@ static void do_gravity_task_cb_ex(
if (sculpt_brush_test_sq_fn(&test, vd.co)) {
const float fade = tex_strength(
ss, brush, vd.co, sqrtf(test.dist),
- vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, thread_id);
+ vd.no, vd.fno, vd.mask ? *vd.mask : 0.0f, tls->thread_id);
mul_v3_v3fl(proxy[vd.i], offset, fade);
@@ -3392,7 +3394,8 @@ static void sculpt_topology_update(Sculpt *sd, Object *ob, Brush *brush, Unified
}
}
-static void do_brush_action_task_cb(void *userdata, const int n)
+static void do_brush_action_task_cb(void *userdata, const int n,
+ const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
@@ -3533,7 +3536,8 @@ static void sculpt_flush_pbvhvert_deform(Object *ob, PBVHVertexIter *vd)
copy_v3_v3(me->mvert[index].co, newco);
}
-static void sculpt_combine_proxies_task_cb(void *userdata, const int n)
+static void sculpt_combine_proxies_task_cb(void *userdata, const int n,
+ const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
@@ -3628,7 +3632,8 @@ static void sculpt_update_keyblock(Object *ob)
}
}
-static void sculpt_flush_stroke_deform_task_cb(void *userdata, const int n)
+static void sculpt_flush_stroke_deform_task_cb(void *userdata, const int n,
+ const ParallelRangeTLS *UNUSED(tls))
{
SculptThreadedTaskData *data = userdata;
SculptSession *ss = data->ob->sculpt;
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 44bd872d107..ed3acf0edbb 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -316,7 +316,8 @@ static bool sculpt_undo_restore_mask(bContext *C, DerivedMesh *dm, SculptUndoNod
return 1;
}
-static void sculpt_undo_bmesh_restore_generic_task_cb(void *userdata, const int n)
+static void sculpt_undo_bmesh_restore_generic_task_cb(void *userdata, const int n,
+ const ParallelRangeTLS *UNUSED(tls))
{
PBVHNode **nodes = userdata;