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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-07-25 17:51:48 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-07-31 10:24:30 +0300
commit51c38b5d495e406a0c13216470927c5ce0f71e4f (patch)
treed76b16650bb935697e7e0393f1d734ddab11d92d /source/blender/blenlib
parent5300ba0ba50efb1656a2effa1053fb60875398ef (diff)
Subsurf: Rework in a way that patches boundaries are merged together
The idea is to create vertices along the coarse edges once, without splitting coarse edges on separate ptex faces. This requires some indexing magic, vertices within a patch are no longer sequential. Not sure how to make it nicer without such a black magic looking calculations (which are basically boiling down to mimicking order of verts/edges creation). In the current offsets calculation loose verts and edges are not properly taken into account, but those are causing topology refiner to fail anyway, so it needs a bit deeper change. Reviewers: brecht Differential Revision: https://developer.blender.org/D3570
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_bitmap.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_bitmap.h b/source/blender/blenlib/BLI_bitmap.h
index 82704e95fdd..bf3329f8ed5 100644
--- a/source/blender/blenlib/BLI_bitmap.h
+++ b/source/blender/blenlib/BLI_bitmap.h
@@ -70,6 +70,12 @@ typedef unsigned int BLI_bitmap;
((_bitmap)[(_index) >> _BITMAP_POWER] & \
(1u << ((_index) & _BITMAP_MASK))))
+#define BLI_BITMAP_TEST_AND_SET_ATOMIC(_bitmap, _index) \
+ (CHECK_TYPE_ANY(_bitmap, BLI_bitmap *, const BLI_bitmap *), \
+ (atomic_fetch_and_or_uint8((uint8_t*)&(_bitmap)[(_index) >> _BITMAP_POWER], \
+ (1u << ((_index) & _BITMAP_MASK))) & \
+ (1u << ((_index) & _BITMAP_MASK))))
+
#define BLI_BITMAP_TEST_BOOL(_bitmap, _index) \
(CHECK_TYPE_ANY(_bitmap, BLI_bitmap *, const BLI_bitmap *), \
(BLI_BITMAP_TEST(_bitmap, _index) != 0))