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/paint_cursor.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index a3e69a1024b..81177dd8199 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -210,6 +210,13 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
int i;
float y;
float len;
+ int thread_num;
+
+#ifdef _OPENMP
+ thread_num = omp_get_thread_num();
+#else
+ thread_num = 0;
+#endif
for (i = 0; i < size; i++) {
@@ -249,7 +256,7 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
if (col) {
float rgba[4];
- paint_get_tex_pixel_col(mtex, x, y, rgba, pool, omp_get_thread_num());
+ paint_get_tex_pixel_col(mtex, x, y, rgba, pool, thread_num);
buffer[index * 4] = rgba[0] * 255;
buffer[index * 4 + 1] = rgba[1] * 255;
@@ -257,7 +264,7 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
buffer[index * 4 + 3] = rgba[3] * 255;
}
else {
- float avg = paint_get_tex_pixel(mtex, x, y, pool, omp_get_thread_num());
+ float avg = paint_get_tex_pixel(mtex, x, y, pool, thread_num);
avg += br->texture_sample_bias;