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.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 1a5ccc8f8bd..a3e69a1024b 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -45,6 +45,7 @@
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_image.h"
+#include "BKE_node.h"
#include "BKE_paint.h"
#include "BKE_colortools.h"
@@ -60,6 +61,10 @@
* removed eventually (TODO) */
#include "sculpt_intern.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+
/* TODOs:
*
* Some of the cursor drawing code is doing non-draw stuff
@@ -197,6 +202,9 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
pool = BKE_image_pool_new();
+ if (mtex->tex && mtex->tex->nodetree)
+ ntreeTexBeginExecTree(mtex->tex->nodetree); /* has internal flag to detect it only does it once */
+
#pragma omp parallel for schedule(static)
for (j = 0; j < size; j++) {
int i;
@@ -241,7 +249,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);
+ paint_get_tex_pixel_col(mtex, x, y, rgba, pool, omp_get_thread_num());
buffer[index * 4] = rgba[0] * 255;
buffer[index * 4 + 1] = rgba[1] * 255;
@@ -249,7 +257,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);
+ float avg = paint_get_tex_pixel(mtex, x, y, pool, omp_get_thread_num());
avg += br->texture_sample_bias;
@@ -272,6 +280,9 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
}
}
+ if (mtex->tex && mtex->tex->nodetree)
+ ntreeTexEndExecTree(mtex->tex->nodetree->execdata);
+
if (pool)
BKE_image_pool_free(pool);