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
AgeCommit message (Collapse)Author
2017-03-11Cleanup: code style & cmakeCampbell Barton
2017-03-08Rename BLI_rct*_init_pt_size -> radiusCampbell Barton
2017-03-08Fix T50886: Blender crashes on renderSergey Sharybin
Was a mistake in one of the previous TLS commits. See comment in the pool_create to see some details why it was crashing.
2017-03-07Task scheduler: Add concept of suspended poolsSergey Sharybin
Suspended pools allows to push huge amount of initial tasks without any threading synchronization and hence overhead. This gives ~50% speedup of cached rigid body with file from T50027 and seems to have no negative affect in other scenes here.
2017-03-07Task scheduler: Initial implementation of local tasks queuesSergey Sharybin
The idea is to allow some amount of tasks to be pushed from working thread to it's local queue, so we can acquire some work without doing whole mutex lock. This should allow us to remove some hacks from depsgraph which was added there to keep threads alive.
2017-03-07Task scheduler: Use real pthread's TLS to access active thread's dataSergey Sharybin
This allows us to avoid TLS stored in pool which gives us advantage of using pre-allocated tasks pool for the pools created from non-main thread. Even on systems with slow pthread TLS it should not be a problem because we access it once at a pool construction time. If we want to use this more often (for example, to get rid of push_from_thread) we'll have to do much more accurate benchmark.
2017-03-07Task scheduler: Refactor the way we store thread-spedific dataSergey Sharybin
Basically move all thread-specific data (currently it's only task memory pool) from a dedicated array of taskScheduler to TaskThread. This way we can add more thread-specific data in the future with less of a hassle.
2017-03-07Task scheduler: Remove per-pool threads limitSergey Sharybin
This feature was adding extra complexity to task scheduling which required yet extra variables to be worried about to be modified in atomic manner, which resulted in following issues: - More complex code to maintain, which increases risks of something going wrong when we modify the code. - Extra barriers and/or locks during task scheduling, which causes extra threading overhead. - Unable to use some other implementation (such as TBB) even for the comparison tests. Notes about other changes. There are two places where we really had to use that limit. One of them is the single threaded dependency graph. This will now construct a single-threaded scheduler at evaluation time. This shouldn't be a problem because it only happens when using debugging command line arguments and the code simply don't run in regular Blender operation. The code seems a bit duplicated here across old and new depsgraph, but think it's OK since the old depsgraph is already gone in 2.8 branch and i don't see where else we might want to use such a single-threaded scheduler. When/if we'll want to do so, we can move it to a centralized single-threaded scheduler in threads.c. OpenGL render was a bit more tricky to port, but basically we are using conditional variables to wait background thread to do all the job.
2017-03-06Task scheduler: Cleanup, use BLI_assert() instead of assert()Sergey Sharybin
2017-03-05BLI_rect: add init from point functionsCampbell Barton
Initialize a rectangle from point+size.
2017-03-03Fix own previous commit, sorry about that :(Bastien Montagne
2017-03-03Get rid of `BLI_task_pool_stop()`.Bastien Montagne
Comments said that function was supposed to 'stop worker threads', but it absolutely did not do anything like that, was merely wiping out TODO queue of tasks from given pool (kind of subset of what `BLI_task_pool_cancel()` does). Misleading, and currently useless, we can always add it back if we need it some day, but for now we try to simplify that area.
2017-03-03Fix ugly mistake in BLI_task - freeing while some tasks are still being ↵Bastien Montagne
processed. Freeing pool was calling `BLI_task_pool_stop()`, which only clears pool's tasks that are in TODO queue, whithout ensuring no more tasks from that pool are being processed in worker threads. This could lead to use-after-free random (and seldom) crashes. Now use instead `BLI_task_pool_cancel()`, which does waits for all tasks being processed to finish, before returning.
2017-03-03Cleanup: IndentationSergey Sharybin
2017-03-02Threads: Use atomics instead of spin when entering threaded mallocSergey Sharybin
2017-03-01Task scheduler: Remove query for the pool's number of threadsSergey Sharybin
Not really happy of per-pool threads limit, need to find better approach to that. But at least it's possible to get rid of half of the nastyness here by removing getter which was only used in an assert statement. That piece of code was already well-tested and this code becomes obsolete in the new depsgraph and does no longer exists in blender 2.8 branch.
2017-03-01Task scheduler: Remove counter of done tasksSergey Sharybin
This was only used for progress report, and it's wrong because: - Pool might in theory be re-used by different tasks - We should not make any decision based on scheduling stats Proper way is to take care of progress by the task itself.
2017-02-26Cleanup: minor changes to array_storeCampbell Barton
- remove unused struct member. - misleading variable name.
2017-02-19Fix a few compiler warnings with macOS / clang.Brecht Van Lommel
2017-02-17Remove unused functions related to distance between BoundBox and rayGermano Cavalcante
2017-02-15Comments: notes on polyfill2d, minor correctionsCampbell Barton
2017-02-07PIL_time_utildefines: also show total time in TIMEIT_AVERAGED.Bastien Montagne
2017-02-06Add shortcuts for unsigned int, short, long and charSergey Sharybin
Feel free to use those in the new code. And stay away from simple "unsigned".
2017-02-06C++ conformance fixes (MSVC /permissive-)Phil Christensen
We (the Microsoft C++ team) use the Blender project as part of our "Real world code" tests. I noticed a place in WIN32 specific code (dvpapi.cpp:85) where a string literal is losing its const-ness when being passed to BLI_dynlib_open(). This is not permitted when using the /permissive- conformance compiler switch (see our blog https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/) My suggested fix is to add const and propagate it where needed. Another possible fix would be to explicitly cast away the const. Reviewers: mont29, sergey, LazyDodo Subscribers: Blendify, sergey, mont29, LazyDodo Tags: #platform:_windows Differential Revision: https://developer.blender.org/D2495
2017-01-29New math_geom function `isect_ray_aabb_v3_simple`Germano Cavalcante
The new `isect_ray_aabb_v3_simple` function replaces the `BKE_boundbox_ray_hit_check` and can be used in BVHTree Root (first AABB). So it is much more efficient.
2017-01-20Fix own mistake in rB051526da6279, confusing off_t with ptrdiff_t.Bastien Montagne
2017-01-20Cleanup/fix some BLI_string_utf8 not using size_t/off_t as expected.Bastien Montagne
2017-01-20Cleanup/fix last remnant usages of int instead of size_t for string length ↵Bastien Montagne
in BLI_string_utils.
2017-01-16Cleanup/refactor: move BKE_deform_flip_side_name & co to BLI_string_utilsBastien Montagne
Functions like that do not have anything to do in BKE really, even less when actually more used for bones than vgroups!
2017-01-16Cleanup/refactor: Add new BLI_string_util.Bastien Montagne
Things like `BLI_uniquename` had nothing, but really nothing to do in BLI_path_util files! Also, got rid of length limitation in `BLI_uniquename_cb`, we can use alloca here to avoid overhead of malloc while keeping free size (within reasonable limits of course).
2017-01-16Cleanup: remove unused & unimplemented `BLI_newname`.Bastien Montagne
2017-01-14Add 3d to 2d plane mapping functions to math libLuca Rood
This adds two functions to project 3d coordinates onto a 3d plane, to get 2d coordinates, essentially eliminating the plane's normal axis from the coordinates. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D2460
2017-01-11Split interp_weights_face_v3 into specific functions for tris and quadsLuca Rood
This splits `interp_weights_face_v3` into `interp_weights_tri_v3` and `interp_weights_quad_v3`, in order to properly handle three sided polygons without needing a useless extra index in your weight array. This also improves clarity and consistency with other math_geom functions, thus reducing potential future errors. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D2461
2017-01-11Add mid_v3_v3_array function and remove redundant functionsLuca Rood
Other than implementing a `mid_v3_v3_array` function, this removes `cent_tri_v3` and `cent_quad_v3` in favor of `mid_v3_v3v3v3` and `mid_v3_v3v3v3v3` respectively. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D2459
2017-01-03Fix implicit size_t to int conversion.Bastien Montagne
Seems like it was erroring on some buildbots...
2017-01-02Cleanup: redundant assignment in rect resizeCampbell Barton
2017-01-01Fix (unreported) fully broken 'sanitize utf-8' helper.Bastien Montagne
That code was a joke, letting some invalid utf8 bytes pass, returning wrong offset for some invalid sequences, not to mention length and pointer easily going out of sync, NULL final byte being 'forgotten' by memcpy, etc. etc. The miracle here is that we could survive using this for so long! Probably because we do not use utf-8 sanitizing enough in Blender, actually... :/
2016-12-28Comments: mul_project_m4_v3_zfacCampbell Barton
2016-12-27Comments: hints for perspective functionsCampbell Barton
Note which GL functions these are equivalent to.
2016-12-04Cleanup: simplify bitmap line drawingCampbell Barton
- Expand overly dense & confusing delta assignments. - Replace bit shift with multiply. Also link to 'clipped' version of this function which may be useful to add later.
2016-12-03Fix macOS build with openimageio 1.7.8 and openexr.Brecht Van Lommel
These macros conflict and are no longer needed with C99 or C++ anyway.
2016-11-29Math lib: Fix use function of wrong dimensionSergey Sharybin
Seems to be a typo in recent commit e1e49fd.
2016-11-25Math Lib: avoid temp array for rotate_m4Campbell Barton
No need to have temp array storage, avoid 2x loops.
2016-11-25Math Lib: rotate matrix cleanupCampbell Barton
- Remove 'rotate_m2', unlike 'rotate_m4' it created a new matrix duplicating 'angle_to_mat2' - now used instead. (better avoid matching functions having different behavior). - Add 'axis_angle_to_mat4_single', convenience wrapper for 'axis_angle_to_mat3_single'. - Replace 'unit_m4(), rotate_m4()' with a single call to 'axis_angle_to_mat4_single'.
2016-11-15Atomics: Make naming more obvious about which value is being returnedSergey Sharybin
2016-10-26BLI_bitmap_draw_2d: optimize polygon fillingCampbell Barton
Existing method was fine for basic polygons but didn't scale well because its was checking all coordinates for every y-pixel. Heres an optimized version. Basic logic remains the same this just maintains an ordered list of intersections, tracking in-out points, to avoid re-computing every row, this means sorting is only done once when out of order segments are found, the segments only need to be re-ordered if they cross each other. Speedup isn't linear, test with full-screen complex lasso gave 11x speedup.
2016-10-26Cleanup: rename functions in BLI_bitmap_draw_2dCampbell Barton
2016-10-26Cleanup: move bitmap drawing into its own moduleCampbell Barton
Bitmap drawing is out-of-scope for a general math API, move to BLI_bitmap_draw_2d.
2016-10-25API: Fix LinksAaron Carlisle
Self-explanatory. to find broken links run `sphinx-build -b linkcheck sphinx-in sphinx-out` Reviewers: mont29 Tags: #bf_blender, #python, #infrastructure:_websites Differential Revision: https://developer.blender.org/D2297
2016-10-08BLI_task: fix case were some pool could work in more threads than allowed.Bastien Montagne
We were checking for number of tasks from given pool already active, and then atomically increasing it if allowed - this is not correct, number could be increased by another thread between check and atomic op! Atomic primitives are nice, but you must be very careful with *how* you use them... Now we atomically increase counter, check result, and if we end up over max value, abort and decrease counter again. Spotted by Sergey, thanks!