Commit Graph

2738 Commits

Author SHA1 Message Date
Campbell Barton
19b7bb5975 Optimize mempool: round chunk size to powers of 2, account for slop-space
This helps to reduce memory fragmentation.
2014-04-05 12:14:05 +11:00
Campbell Barton
af59ee340f Mempool: remove BLI_MEMPOOL_SYSMALLOC, MEM_* allocs are more efficient now 2014-04-05 12:14:05 +11:00
Campbell Barton
70353f833a Optimize mempool: replace double linked list with single for memory chunks 2014-04-05 09:49:13 +11:00
Campbell Barton
7cb90a611f Optimization for mempool initial chunk allocation
Almost all pools allocated 2 chunks on initialization,
every element needed to be added to the free-list which
would never be used for small pools.

Now allocate only one, gives minor speedup for some bmesh operations.
2014-04-04 21:25:08 +11:00
Campbell Barton
5770d691bb Optimize BLI_convexhull_aabb_fit_hull_2d, avoid atan2, sin, cos
add utility functions for using a 2d unit vector as a rotation matrix
mul_v2_v2_cw & mul_v2_v2_ccw
2014-04-03 21:47:03 +11:00
Bastien Montagne
35747ee3d5 Rename "BLI_cpu.h" to "BLI_system.h" and add to it BLI_getpid() helper.
There is not much sense to have a whole BLI file just to check SSE2 on CPUs...
So idea is to rename it to more generic "BLI_system", and add to it more system-related
utils, like e.g. an include helper for getpid(), which allows to hide unix/windows
internals from rest of the code...

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D439
2014-04-02 11:59:43 +02:00
Campbell Barton
1d9e0c373d Fix for BLI_rng_shuffle_array noted by mont29 2014-04-02 10:09:48 +11:00
Campbell Barton
da4b90a331 Code cleanup: use uint64_t for BLI_rand 2014-04-02 09:58:27 +11:00
Jens Verwiebe
62dc18c717 Fix an unused function warning without openmp present, some typos 2014-04-01 11:23:28 +02:00
Campbell Barton
e95fd79258 Correction for error in own recent commit (makesrna c++ api, un-init var) 2014-04-01 16:53:15 +11:00
Campbell Barton
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
Campbell Barton
097a3756c0 Code cleanup: use bool 2014-03-31 23:39:08 +11:00
Jens Verwiebe
277fb1a31f Sculpt/dyntopo: Make the omp threads configurable to overcome performance issues
- autodetect optimal default, which typically avoids HT threads
- can store setting in .blend per scene
- this does not touch general omp max threads, due i found other areas where the calculations are fitting for huge corecount
- Intel notes, some of the older generation processors with HyperThreading would not provide significant performance boost for FPU intensive applications. On those systems you might want to set OMP_NUM_THREADS = total number of cores (not total number of hardware theads).
2014-03-31 13:51:49 +02:00
Campbell Barton
0055162b75 Tweak slerp assert to be less picky 2014-03-31 14:55:12 +11:00
Campbell Barton
55f83e36cc Py API: Vector.slerp(). also added interp_v3_v3v3_slerp(_safe) functions 2014-03-31 13:28:37 +11:00
Campbell Barton
6aa75d3b2c Fix for error in normalize_vn_vn(), add len_squared_vn 2014-03-31 11:19:32 +11:00
Thomas Dinges
b99977ac60 And another compile fix for M_PI and msvc2008... 2014-03-30 15:36:09 +02:00
Campbell Barton
0319db1063 Correct own recent changes broke release builds 2014-03-30 20:35:59 +11:00
Campbell Barton
8d1b289b78 Code cleanup: warnings (clang) 2014-03-30 19:37:43 +11:00
Campbell Barton
c16bd951cd Enable GCC pedantic warnings with strict flags,
also modify MIN/MAX macros to prevent shadowing.
2014-03-30 15:04:20 +11:00
Campbell Barton
5819421e1b correct recent commit 2014-03-30 15:04:20 +11:00
Campbell Barton
bbfeb120fc Code cleanup: use strict flags for BLI_rand 2014-03-30 15:04:20 +11:00
Campbell Barton
faf529d036 BLI_rand: Add BLI_rng_get_float_unit_v3, was static rayshade func 2014-03-30 15:04:20 +11:00
Campbell Barton
a6e8137983 Convenience macro for print_ funcs, saves passing id each time 2014-03-30 15:04:20 +11:00
Campbell Barton
480c5019bb Code cleanup: reflect_v3_v3v3 made redundant copies 2014-03-30 12:28:09 +11:00
Campbell Barton
3bd15fcf15 Correction for poly_to_tri_count (used over-complicated method) 2014-03-30 12:05:42 +11:00
Campbell Barton
1f58bfb8be Code cleanup: de-duplicate cotangent weight function & add arg sizes 2014-03-30 11:08:33 +11:00
Campbell Barton
23ef10c705 Code cleanup: kdopbvh, move minmax init into function 2014-03-30 10:33:01 +11:00
Campbell Barton
2100fb4094 Code cleanup: avoid setting du/dv twice with ray intersection 2014-03-29 22:38:01 +11:00
Campbell Barton
fb0959f88d Code cleanup: replace dot with len_squared and is_zero checks 2014-03-29 22:24:12 +11:00
Campbell Barton
ac07046e55 BMesh: optimize quad_coord, avoid duplicate sqrt calls 2014-03-28 15:25:02 +11:00
Campbell Barton
5981567ec6 Code cleanup: use len_v2v2_int for view zoom-scale 2014-03-28 15:02:57 +11:00
Campbell Barton
7199e2288f Code cleanup: use sqrtf when input and output are float 2014-03-28 14:53:37 +11:00
Campbell Barton
bec7c8c7aa BMesh: optimize BM_face_legal_splits for concave faces 2014-03-27 11:48:18 +11:00
Campbell Barton
20a4e33837 Code cleanup: use consistent arg order for math api poly funcs 2014-03-27 08:30:14 +11:00
Dalai Felinto
b4d259f044 New resolve_tri_uv_v3 util function
Compute barycentric coordinates (u, v) for a point with respect to a
triangle.

This is needed for Cycles baking but we decided to push this
independently of the upcoming main baking changes.

Code adapted from Christer Ericson's Real-Time Collision Detection.

Cleanup, refactoring and review from Campbell Barton.
2014-03-25 21:58:52 -03:00
Campbell Barton
a7242c3162 Code cleanup: add _v2 suffix to resolve_tri/quad functions 2014-03-26 11:15:21 +11:00
Sergey Sharybin
b7dbb2f48e Correction to the previous commit 2014-03-25 16:22:47 +06:00
Sergey Sharybin
d4cc81d552 Fix T38870: Freezes when jumping in front of a keyframe.
Issue was caused by inverting a degenerate matrix when
evaluating drivers.

Solved by using tweaked inverse code (same as used in Cycles).

Should have no affect on cases when matrix is not degenerate.
2014-03-25 16:07:13 +06:00
Campbell Barton
f0ca40f9c1 Code cleanup: function calls 2014-03-25 10:10:00 +11:00
Campbell Barton
05deec3204 Code cleanup: rename easing functions with BLI_easing_ prefix 2014-03-25 09:59:10 +11:00
Campbell Barton
673b665471 Code cleanup: rename BLI_math_easing to BLI_easing
Many hard coded values and really specific to time & keyframes.
2014-03-25 09:59:10 +11:00
Campbell Barton
32d5d072a0 Code cleanup: float/double promotion 2014-03-24 13:31:14 +11:00
Campbell Barton
551d1a1ed5 Code cleanup: style 2014-03-24 13:14:19 +11:00
Campbell Barton
25b4b5fb9f Fix for invalid abs() use (from daccaa7) 2014-03-24 12:57:18 +11:00
Antony Riakiotakis
1206faeb99 Warning cleanup:
* Comparison in utf detection code always failed
* Cast to integer to silence grumpy 64bit gcc
2014-03-22 14:41:38 +02:00
Thomas Dinges
44dc72334d Compile fix for Windows, M_PI was undefined. 2014-03-21 17:46:18 +01:00
Joshua Leung
daccaa713b Patch T22084: Robert Penner Easing Equations for FCurves
This commit introduces support for a number of new interpolation types
which are useful for motion-graphics work. These define a number of
"easing equations" (basically, equations which define some preset
ways that one keyframe transitions to another) which reduce the amount
of manual work (inserting and tweaking keyframes) to achieve certain
common effects. For example, snappy movements, and fake-physics such
as bouncing/springing effects.

The additional interpolation types introduced in this commit can be found
in many packages and toolkits (notably Qt and all modern web browsers).
For more info and a few live demos, see [1] and [2].


Credits:
* Dan Eicher (dna)              - Original patch
* Thomas Beck (plasmasolutions) - Porting/updating patch to 2.70 codebase
* Joshua Leung (aligorith)      - Code review and a few polishing tweaks

Additional Resources:
[1] http://easings.net
[2] http://www.robertpenner.com/easing/
2014-03-22 03:00:27 +13:00
Lukas Tönne
2ea78fb28f Fix for clang build warnings: ATTR_WARN_UNUSED_RESULT is used after
the inline definitions are included, which gives lots of warnings
"attribute declaration must precede definition".

See also rB83617429cf28f2a19e991a0f71d892fc159a4419
2014-03-20 13:16:59 +01:00
Campbell Barton
27e86ed832 Code cleanup: use bools 2014-03-20 22:56:28 +11:00