Fix #23170: multithreaded texture baking could give wrong results with margin,
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 23 Sep 2010 21:38:01 +0000 (21:38 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 23 Sep 2010 21:38:01 +0000 (21:38 +0000)
with some threads not writing the margin mask.

source/blender/render/intern/source/rendercore.c

index 8e1a959..bd4af52 100644 (file)
@@ -2562,10 +2562,9 @@ static void shade_tface(BakeShade *bs)
        if (bs->usemask) {
                if (bs->ibuf->userdata==NULL) {
                        BLI_lock_thread(LOCK_CUSTOM1);
-                       if (bs->ibuf->userdata==NULL) /* since the thread was locked, its possible another thread alloced the value */
+                       if (bs->ibuf->userdata==NULL) /* since the thread was locked, its possible another thread alloced the value */
                                bs->ibuf->userdata = (void *)MEM_callocN(sizeof(char)*bs->rectx*bs->recty, "BakeMask");
-                               bs->rect_mask= (char *)bs->ibuf->userdata;
-                       }
+                       bs->rect_mask= (char *)bs->ibuf->userdata;
                        BLI_unlock_thread(LOCK_CUSTOM1);
                } else {
                        bs->rect_mask= (char *)bs->ibuf->userdata;