Commit Graph

4143 Commits

Author SHA1 Message Date
Sergey Sharybin
7ccef23c4d Add C++ guards to some blenlib headers 2019-01-31 14:22:46 +01:00
Campbell Barton
c0f88ed8a8 Cleanup: sort forward declarations of enum & struct
Done using:
  source/tools/utils_maintenance/c_sort_blocks.py
2019-01-28 21:17:58 +11:00
Campbell Barton
f20dbc293f Cleanup: blank lines over doxy headers 2019-01-26 21:43:24 +11:00
Campbell Barton
1e4aab36c2 Cleanup: remove redundant BKE/BLI/BIF headers 2019-01-26 21:20:25 +11:00
Andrew Williams
102631486b Fix potential invalid memory access in surface force field BVH tree.
Free the BVH tree immediately along with the mesh, otherwise we might access
invalid mesh data.

Differential Revision: https://developer.blender.org/D4201
2019-01-22 15:24:06 +01:00
Bastien Montagne
482c4d099a Cleanup: remove all BLI_utiledefines' ugly vectorial macros.
Not only were those often making doublons with already existing
BLI_math's stuff, but they were also used to hide implicit type
conversions...

As usual this adds some more exotic inlined vector functions (one of
the rare cases where I really miss C++ and its templates... ;) ).
2019-01-20 16:27:06 +01:00
Campbell Barton
8a61ea7296 Cleanup: add trailing commas
Prevents clang-format merging into a single line.
2019-01-19 13:58:35 +11:00
Sergey Sharybin
cb5302f962 Math: Make it possible to use vector for both input and output
Avoids nasty code all over where such math is required, and
compilers can easily deal with such situation.

Don't prefer questionable micro-optimization which comes with
a cost of nasty actual logic code.
2019-01-18 12:29:53 +01:00
Campbell Barton
8efedf2523 Cleanup: style 2019-01-18 08:59:41 +11:00
Campbell Barton
6299d84e10 Fix uninitialized variable use w/ kdopbvh ray projection
Snapping verts for eg would use these values uninitialized.
2019-01-16 15:02:58 +11:00
Campbell Barton
88a80fcec8 Cleanup: commas at the end of enums
Without this clang-format may wrap them onto a single line.
2019-01-16 00:03:03 +11:00
Campbell Barton
4226ee0b71 Cleanup: comment line length (blenlib)
Prevents clang-format wrapping text before comments.
2019-01-15 23:30:31 +11:00
Campbell Barton
302970b7a5 MSVC: remove compiler __func__ define
No longer needed and exposes a bug in clang-format see: D4185
2019-01-11 09:22:21 +11:00
Campbell Barton
5681631109 Cleanup: ensure header guards come first
Causes clang-format not to detect header guards,
indenting all preprocessor lines in the header.
2019-01-10 08:46:38 +11:00
Campbell Barton
91a155833e Cleanup: comments causing bad clang-format output 2019-01-08 10:37:43 +11:00
Campbell Barton
a2120001a8 Cleanup: avoid function call for pointer compare 2019-01-05 19:56:15 +11:00
Campbell Barton
9200dc0eb1 Cleanup: preprocessor indentation 2019-01-03 15:52:07 +11:00
Campbell Barton
543ddbe6bf Cleanup: warnings (clang) 2018-12-30 15:15:05 +11:00
Brecht Van Lommel
5216dd5fce Merge branch 'blender2.7' 2018-12-27 10:53:02 +01:00
Bastien Montagne
1ac311cedc Fix/cleanup another bunch of UI messages issues.
Also (mostly in comments): behaviour -> behavior (we use American English).
2018-12-24 12:32:43 +01:00
Alexander Gavrilov
02f083cdce BLI_math_rotation: properly name the quaternion power function.
"angular mult factor" is a completely unintelligible description
for a function that raises a unit quaternion to the scalar power.
2018-12-23 15:28:32 +03:00
Brecht Van Lommel
c93fd8438c Cleanup: fix more ATTR_FALLTHROUGH warnings.
Ref D3960.
2018-12-21 17:23:49 +01:00
Alexander Gavrilov
d211c9aa0a BLI_bitmap: add functions operating on the whole bitmask.
There is no point having operations that iterate over the whole
bit array as macros, so convert BLI_BITMAP_SET_ALL to a function.
Also, add more utilities for copying and manipulating masks.

Reviewers: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D4101
2018-12-19 15:53:12 +03:00
Sergey Sharybin
604f5cf3f4 Cleanup: Typo in comment 2018-12-18 12:55:13 +01:00
Sergey Sharybin
486be2219a Use proper buffer size for statistics 2018-12-18 12:54:49 +01:00
Sebastian Parborg
1eafa91f64 Fix T59424: color wheel snaps to center, losing hue when value is zero.
Differential Revision: https://developer.blender.org/D4090
2018-12-17 19:18:16 +01:00
Bastien Montagne
ce3d00b9b7 Fix T59404: Mistake in recent EdgeHash refactor broke edge generations in mesh validate code. 2018-12-17 14:28:29 +01:00
Brecht Van Lommel
f527ce5b2f Color management: add OCIO aware utility functions for transform to/from XYZ. 2018-12-13 19:25:46 +01:00
Campbell Barton
a3375729f8 Cleanup: macro hygiene, style, doxy comments 2018-12-13 23:04:14 +11:00
Campbell Barton
54fa78a048 BLI_edgehash: assert when edges use the same vert
This was removed on the recent upgrade.
2018-12-13 22:46:17 +11:00
Jacques Lucke
aa63a87d37 BLI: New Edgehash and EdgeSet implementation
The new data structure uses open addressing instead of chaining to resolve collisions in the hash table.

This new structure was never slower than the old implementation in my tests. Code that first inserts all edges and then iterates through all edges (e.g. to remove duplicates) benefits the most, because the `EdgeHashIterator` becomes a simple for loop over a continuous array.

Reviewer: campbellbarton

Differential Revision: D4050
2018-12-13 11:21:31 +01:00
Campbell Barton
49490e5cfb Merge branch 'master' into blender2.8 2018-12-12 13:02:09 +11:00
Campbell Barton
e757c4a3be Cleanup: use colon separator after parameter
Helps separate variable names from descriptive text.
Was already used in some parts of the code,
double space and dashes were used elsewhere.
2018-12-12 12:50:58 +11:00
Campbell Barton
16fc62e15f Docs: correct doxy comments 2018-12-12 12:18:52 +11:00
Sybren A. Stüvel
879877295d Simplified #ifdef to not silently fail on certain platforms 2018-12-09 19:24:12 +01:00
Campbell Barton
1ddfd8c9ec Cleanup: style 2018-12-08 15:01:47 +11:00
Sybren A. Stüvel
6a5e809697 Move static get_hostname() to BLI_hostname() in system.c
This makes the `#include <Windows.h>` use more localised and out of the
`image.c` file.

Reviewers: LazyDodo

Reviewed by: LazyDodo

Differential revision: https://developer.blender.org/D4049
2018-12-07 19:28:08 +01:00
Alexander Gavrilov
01581d4a1e BLI_task: fix queue in work_and_wait, and support resetting.
To make the pool more usable for running multiple stages of tasks,
fix local queue handling in BLI_task_pool_work_and_wait.

Specifically, after the wait loop the local queue should be empty,
or the wait part of the function contract isn't fulfilled. Instead,
check and run any tasks in queue before the wait loop.

Also, add a new function that resets the suspended state of the pool.
2018-12-04 14:08:50 +03:00
Sergey Sharybin
df2635099b Merge branch 'master' into blender2.8 2018-12-04 11:45:22 +01:00
Sergey Sharybin
3f31ec8398 Cleanup: Spelling 2018-12-04 11:43:53 +01:00
Campbell Barton
81f898f053 Merge branch 'master' into blender2.8 2018-12-01 08:19:38 +11:00
Campbell Barton
a9bd788348 Cleanup: style 2018-12-01 08:15:25 +11:00
Campbell Barton
7e21c99d05 PyAPI: add load_factory_startup_post handler
Needed so we can apply changes to the startup file,
only in the case when it's load loaded from a user-saved startup.
2018-11-30 13:33:13 +11:00
Campbell Barton
2089feeb1b Fix leak in CPU brand check 2018-11-29 12:52:39 +11:00
Campbell Barton
67d77f47f0 Fix leak in CPU brand check 2018-11-29 08:22:15 +11:00
Sergey Sharybin
3ed0d5b4d4 Merge branch 'master' into blender2.8 2018-11-28 14:42:38 +01:00
Sergey Sharybin
ce927e15e0 Tweaks for threading schedule for Threadripper2 and EPYC
The idea is to make main thread and job threads to be scheduled
on CPU dies which has direct access to memory (those are NUMA
nodes 0 and 2).

We also do this for new EPYC CPUs since their NUMA nodes 1 and 3
do have access but only to a higher range DDR slots. By preferring
nodes 0 and 2 on EPYC we make it so users with partially filled
DDR slots has fast memory access.

One thing which is not really solved yet is localization of
memory allocation: we do not guarantee that memory is allocated
on the closest to the NUMA node DDR slot and hope that memory
manager of OS is acting in favor of us.
2018-11-28 14:41:22 +01:00
Sergey Sharybin
b3e2c69416 Add utility function to query CPU brand string 2018-11-28 14:35:26 +01:00
Campbell Barton
62edc31d34 Cleanup: correct function signatures 2018-11-28 16:21:24 +11:00
Campbell Barton
fb262f942e Cleanup: style, includes 2018-11-27 08:01:54 +11:00