Commit Graph

3120 Commits

Author SHA1 Message Date
Campbell Barton 9bff19fbfd GHash, Edgehash: add lookup_default() funcs.
Returns a fallback argument when the key isn't found.
2014-04-22 01:36:59 +10:00
Andrea Weikert 5afb0abfbd Basic support for UNC paths on Windows
Differential Revision: https://developer.blender.org/D298

Allows users on Windows to enter UNC paths in the filebrowser and to link to .blend files on a UNC path. Functionality is limited still, we can't browse the network yet and have no support to check user rights so far.

What works:
- enter an UNC path in the file browser manually or via copy/paste
- navigation within the UNC share subfolders
- link to a file on a UNC share

What does not (yet) work:
- browse the network for computers and shares
- browse to a folder that requires entering user credentials

Contributors:
Rob McKay - original patch
Campbell Barton - style fixes

Reviewers:
Campbell Barton, Brecht van Lommel
2014-04-21 17:06:09 +02:00
Campbell Barton 25c9ea8cb3 GHash, EdgeHash: hint on unlikely branch
also avoid searching buckets for empty hashes
2014-04-21 02:50:07 +10:00
Campbell Barton 55d75f5020 Code cleanup: correct abs use
also minor cleanup to rotation code
2014-04-21 02:02:21 +10:00
Campbell Barton f77207b1c3 Math Lib: faster version of rotation_between_vecs_to_mat3
Use axis/angle calculation but avoid calls to sin/cos
2014-04-20 20:56:40 +10:00
Campbell Barton a51a0ca772 Math Lib: add shell_v3v3_normalized_to_dist and v2 version
bypass angle calculation to avoids (asin, sqrt, cos).
2014-04-19 22:17:10 +10:00
Campbell Barton d6a53bb38f Minor change to recent commit (avoid transpose) 2014-04-19 19:48:07 +10:00
Campbell Barton 0ed6725aae Math Lib: minor optimization to barycentric_transform
replace rotation_between_vecs_to_quat with axis_dominant_v3_to_m3.
2014-04-19 15:52:01 +10:00
Campbell Barton fabc46b41f Math Lib: add rotation_between_vecs_to_mat3
- behaves like rotation_between_vecs_to_quat
- avoids calling sin,cos calls (approx 1.6x faster).
2014-04-19 15:36:47 +10:00
Campbell Barton fc9c790563 Math Lib: minor optimization for axis_angle_normalized_to_mat3 2014-04-19 14:10:22 +10:00
Campbell Barton e5f4f4d484 CMake was missing header 2014-04-18 20:46:14 +10:00
Campbell Barton 3e3efae7e9 Viewport Text Drawing: replace single allocs with a memarena
- pass label strlen since in many cases its already known.
- use single linked list for cached text drawing.
- add BLI_link_utils.h for single linked list macros.

own tests give approx 22% overall speedup.
2014-04-17 16:04:28 +10:00
Campbell Barton 1b9db9911d Code cleanup: use bools
also rename BLI_omp_thread_count -> BLI_system_thread_count_omp
2014-04-17 16:04:28 +10:00
Campbell Barton b3972aeea0 Math Lib: optimize axis_dominant_v3_to_m3, approx 6x speedup
build the matrix directly rather then calculating with axis/angle

also remove unused function calc_poly_plane
2014-04-16 21:07:28 +10:00
Campbell Barton 233dac1494 Math Lib: increase epsilon for ortho_basis_v3v3_v3
passing in a unit length vector wouldn't always compute unit length vectors because the epsilon tested was too small.
2014-04-16 21:07:28 +10:00
Campbell Barton 28a829893c Math Lib: avoid having to pass a pre-calculated normal tot area_poly_v3
add normal_poly_v3
2014-04-16 00:29:57 +10:00
Bastien Montagne d9211b1e7b Fix compilation (size_t not defined) by including stddef.h in BLI_sys_types.h 2014-04-15 09:11:45 +02:00
Campbell Barton aa10cf7f5c GHash: add BLI_ghashutil_uinthash_v4 for hashing 4 ints at once 2014-04-15 14:40:33 +10:00
Campbell Barton a7241d09cd GHash: add typed hash functions (were all (void *))
- BLI_ghashutil_strhash_n takes string length, to avoid terminating the string before hashing.
- BLI_ghashutil_inthash/uinthash take ints, to avoid casting to (void *)

This also showed up incorrect use of inthash, which was using a pointer.
2014-04-15 14:22:36 +10:00
Campbell Barton ad9af56a6e LinkList stack macros to swap and pop into a separate stack. 2014-04-13 20:12:07 +10:00
Campbell Barton 2025e4cbb9 Code cleanup: quiet warnings & style 2014-04-13 11:26:31 +10:00
Campbell Barton c04e73f386 Math Lib: use less strict epsilon with BLI_ASSERT_UNIT_QUAT
was causing issues with pointcache
2014-04-11 18:20:30 +10:00
Campbell Barton a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
Campbell Barton f700a13eb5 Revert "Mempool: simplify memory chunk list building"
This reverts commit c82371fc06.

Caused regression in iterator
2014-04-10 11:35:17 +10:00
Campbell Barton 82628a6b0e Code cleanup: use struct type for mempool & style edits 2014-04-10 06:49:25 +10:00
Campbell Barton 5580afb5df GHash/Edgehash: make simple iterator checking functions inline.
also remove NULL check, only a few areas made use of this.
2014-04-08 15:50:38 +10:00
Campbell Barton c82371fc06 Mempool: simplify memory chunk list building 2014-04-08 13:41:57 +10:00
Campbell Barton 412826a504 Mempool: delay allocating an initial chunk, its not always used 2014-04-08 12:58:56 +10:00
Campbell Barton 5c5d643938 Mempool: use define for used freeword and correct define 2014-04-07 12:52:23 +10:00
Campbell Barton 13d90ab8f7 Mempool: minor optimization to building free pointer list 2014-04-07 12:38:32 +10:00
Campbell Barton aee82b4b2c Mempool: fix own error in recent commit
chunks must be added in order for iteration.
2014-04-07 12:38:32 +10:00
Campbell Barton 2a82b8ade5 Math Lib: add power of 2 min/max for unsigned ints 2014-04-05 21:54:20 +11:00
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