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:
authorAntony Riakiotakis <kalast@gmail.com>2014-03-29 00:01:26 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-03-29 00:02:26 +0400
commit6d973b87a6c0351510603b118814618333318321 (patch)
treed17293f2cbd7c94f353081ca03b2ef5ed067db21 /source/blender/editors/sculpt_paint/paint_cursor.c
parent8b43b9f2552fb6d769c751a1eb8eeb927ebfc079 (diff)
Fix T39468
Issue is that sampling functions did not pass a thread index to the texture sampler so all threads were contesting for the same pool. Paint cursors and sculpting that used openmp for threading suffered from this. Now use omp_get_thread_num to pass the thread number.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_cursor.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 2c2590012f9..a3e69a1024b 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -61,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
@@ -245,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;
@@ -253,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;