Sergey Sharybin
5d38c14116
Merge branch 'master' into blender2.8
2018-01-10 13:22:03 +01:00
Sergey Sharybin
5614193745
Task scheduler: Use restrict pointer qualifier
...
Those pointers are never to be aliased, so let's be explicit about this and hope
compiler does save some CPU ticks.
2018-01-10 12:49:51 +01:00
Sergey Sharybin
518c65460e
Task scheduler: Use more const qualifiers
2018-01-10 12:27:43 +01:00
Sergey Sharybin
f0610563ee
math utils: Add size_t version of min and max functions
2018-01-10 11:06:44 +01:00
Campbell Barton
2b56faebe5
Merge branch 'master' into blender2.8
2018-01-10 19:58:05 +11:00
Campbell Barton
18f53d8822
Cleanup: comment block alignment
2018-01-10 19:57:02 +11:00
Campbell Barton
5ff33ecdf0
Merge branch 'master' into blender2.8
2018-01-10 14:01:09 +11:00
Sergey Sharybin
5fe87a0a8c
Task scheduler: Use single thread branch when range fits into single chunk
2018-01-09 18:10:47 +01:00
Sergey Sharybin
4a3b303bb0
Task scheduler: Fix wrong tasks calculation when chunk size is too big
2018-01-09 18:07:34 +01:00
Sergey Sharybin
6deb908a5c
Merge branch 'master' into blender2.8
2018-01-09 16:15:33 +01:00
Sergey Sharybin
932d448ae0
Task scheduler: Use const qualifiers in parallel range
2018-01-09 16:09:33 +01:00
Sergey Sharybin
8cffb0a141
Task scheduler: Avoid over-allocation of tasks for parallel ranges
...
This seems to only cause extra rthreading overhead on systems with 10s of
threads, without actually solving anything.
2018-01-09 16:09:33 +01:00
Sergey Sharybin
c4e42d70a4
Task scheduler: Add minimum number of iterations per thread in parallel range
...
The idea is to support following: allow doing parallel for on a small range,
each iteration of which takes lots of compute power, but limit such range to
a subset of threads.
For example, on a machine with 44 threads we can occupy 4 threads to handle
range of 64 elements, 16 elements per thread, where each block of 16 elements
is very complex to compute.
The idea should be to use this setting instead of global use_threading flag,
which is only based on size of array. Proper use of the new flag will improve
threadability.
This commit only contains internal task scheduler changes, this setting is not
used yet by any areas.
2018-01-09 16:09:33 +01:00
Sergey Sharybin
3144f0573a
Task scheduler: Simplify parallel range function
...
Basically, split it up and avoid extra abstraction level.
2018-01-09 16:09:33 +01:00
Sergey Sharybin
4c4a7e84c6
Task scheduler: Use single parallel range function with more flexible function
...
Now all the fine-tuning is happening using parallel range settings structure,
which avoid passing long lists of arguments, allows extend fine-tuning further,
avoid having lots of various functions which basically does the same thing.
2018-01-09 16:09:33 +01:00
Sergey Sharybin
d2708b0f73
Task scheduler: Get rid of extended version of parallel range callback
...
Wrap all arguments into TLS type of argument. Avoids some branching and also
makes it easier to extend things in the future.
2018-01-09 16:09:33 +01:00
Campbell Barton
be40389165
Merge branch 'master' into blender2.8
2018-01-03 23:44:47 +11:00
Sergey Sharybin
6efd58dd3e
Task scheduler: Clarify why do we need an atomic add of 0
2017-12-22 16:37:25 +01:00
Sergey Sharybin
50f1c9a8af
Task scheduler: Start with suspended pool to avoid threading overhead on push
...
The idea is to avoid any threading overhead when we start pushing tasks in a
loop. Similarly to how we do it from the new dependency graph. Gives couple of
percent of speedup here, but also improves scalability.
2017-12-22 12:25:11 +01:00
Sergey Sharybin
a52452c043
Merge branch 'master' into blender2.8
2017-12-20 16:40:49 +01:00
Antonio Vazquez
94a3ee56c7
Fix MSVSC2017 error
...
The last compiler version needs this include
2017-12-20 10:23:12 +01:00
Campbell Barton
cfd1b48492
Merge branch 'master' into blender2.8
2017-12-19 14:15:19 +11:00
Campbell Barton
7a58ff928c
Math Lib: signed versions of quaternion angle
...
There was no simple way to get the shortest quaternion angle.
2017-12-19 14:03:29 +11:00
Sergey Sharybin
114013de0d
Merge branch 'master' into blender2.8
2017-12-15 17:24:28 +01:00
Sergey Sharybin
5e28b71457
math utils: Add utilities to scan bit and clear it
2017-12-15 16:54:28 +01:00
Sergey Sharybin
de9e5a0926
Math utils: Go away form naive code for highest_order_bit_uint
2017-12-15 16:54:28 +01:00
Sergey Sharybin
412de222f8
Math utils: Add bit scan operations
2017-12-15 16:54:28 +01:00
Sergey Sharybin
2aa0f8a41b
Math utils: Cleanup, use _uint suffix for function which operates on uint
2017-12-15 16:54:28 +01:00
Campbell Barton
03a5eccc94
Merge branch 'master' into blender2.8
2017-11-30 18:30:41 +11:00
Campbell Barton
28d2148b09
Haiku OS Support
...
D2860 by @miqlas
Even though Haiku is a niche OS, only minor changes are needed.
2017-11-30 18:05:21 +11:00
Brecht Van Lommel
84d39ab97b
Merge branch 'master' into blender2.8
2017-11-29 18:13:06 +01:00
Brecht Van Lommel
4f7280da40
Fix paint float color blending bugs with alpha 1.0 and vivid light.
...
For some blend modes there would be no effect with factor 1.0, even if factor
0.999 would give a very different image. Now the result should have no
discontinuity.
Differential Revision: https://developer.blender.org/D2925
2017-11-29 18:01:36 +01:00
Campbell Barton
f3b384862d
Merge branch 'master' into blender2.8
2017-11-24 14:30:36 +11:00
Bastien Montagne
b63442e0b6
Minor cleanup for own recent commits.
2017-11-23 22:43:11 +01:00
Bastien Montagne
a786baa193
Merge branch 'master' into blender2.8
2017-11-23 21:36:27 +01:00
Bastien Montagne
efb86b712d
Add a new parallel looper for MemPool items to BLI_task.
...
It merely uses the new thread-safe iterators system of mempool, quite
straight forward.
Note that to avoid possible confusion with two void pointers as
parameters of the callback, a dummy opaque struct pointer is used
instead for the second parameter (pointer generated by iteration over
mempool), callback functions must explicitely convert it to expected
real type.
Also added a basic gtest for this new feature.
2017-11-23 21:14:43 +01:00
Bastien Montagne
b84e6dfee4
Add ability to use more than one mempool iterator simultaneously.
...
This will allow threaded tasks to 'consume' all mempool items in
parallel tasks, each one working on a whole chunk at once (to reduce
concurrency managing overhead).
2017-11-23 21:12:00 +01:00
Bastien Montagne
5330e7fd29
Merge branch 'master' into blender2.8
2017-11-23 16:29:00 +01:00
Bastien Montagne
497e2b3dfa
Cleanup: use signed atomic ops when needed.
2017-11-23 16:24:34 +01:00
Sergey Sharybin
5d2b3a966e
Merge branch 'master' into blender2.8
2017-11-22 12:50:17 +01:00
Brecht Van Lommel
96415cb52a
Code cleanup: fix harmless compiler warning.
2017-11-20 23:32:06 +01:00
Julian Eisel
7f96323cd0
Merge branch 'master' into blender2.8
2017-11-19 13:16:14 +01:00
Campbell Barton
83e4e65074
Cleanup: outdated comment
2017-11-19 03:25:52 +11:00
Campbell Barton
40c8a18229
Cleanup: style
2017-11-18 17:22:54 +11:00
Bastien Montagne
562da211c2
Merge branch 'master' into blender2.8
2017-11-16 12:50:53 +01:00
Bastien Montagne
d697e3d46e
BLI listbase: add bytes finding helpers.
...
Quite similar to string ones actually, except more generic. Used in
id_override_static branch currently.
2017-11-16 12:49:31 +01:00
Campbell Barton
ae8130e287
Merge branch 'master' into blender2.8
2017-11-15 23:17:25 +11:00
Campbell Barton
474362b363
Cleanup: use 'uint'
2017-11-15 22:58:39 +11:00
Campbell Barton
9cbf374814
GSet: utils to access data stored outside the set
2017-11-15 22:45:37 +11:00
Bastien Montagne
2a7f8d3cb3
Merge branch 'master' into blender2.8
...
Conflicts:
source/blender/blenlib/BLI_math_matrix.h
source/blender/blenlib/intern/math_matrix.c
source/blender/blenlib/intern/rand.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/makesrna/intern/rna_mask.c
2017-11-15 10:46:19 +01:00