Commit Graph

40450 Commits

Author SHA1 Message Date
Sergey Sharybin
c847198a7b Use one global task scheduler for all the tasks
Instead of allocating scheduler and starting threads
on every object_update call make it so scheduler is
global and threads are always ready to run.

This was we could avoid quite hacky thing which is
counting how much objects need to be updated before
starting threaded update.

It'll also allow using the same scheduler to do all
sorts of tasks, not only objects update in the same
scheduler. This is nice from load balancing point of
view.

Couple of changes were needed to be done in task
scheduler itself:

- Free tas before sending notifier.
- Free TaskThread structures outside from thread.

This is needed to make it possible use begin/end
threaded malloc from the main thread before/after
running the pool. Without this change it was possible
that allocation will switch to non-thread mode while
thread is freeing the task.

This required storing TaskThread array in Scheduler,
but it's not so much bad actually, since it also
reduces memory overhead caused by per-thread allocation.
2013-07-31 21:55:36 +00:00
Sergey Sharybin
853f2e05c8 Optimization and threading fix for shapekeys weights calculation
This commit fixes two different issues, which were caused by
how weights are being calculated for relative shapekeys.

Weights for key block used to saved in KeyBlock DNA structure,
which lead to situations when different objects could start
writing to the same weights array if they're sharing the same
key datablock.

Solved this in a way so weights are never stored in KeyBlock
and being passed to shapekeys routines as an array of pointers.
This way weights are still computed run-time (meaning they're
calculated before shapekey evaluation and freed afterwards).

This required some changes to GameEngine as well, to make it
never cache weights in the key blocks.

Another aspect of this commit makes it so weight for a given
vertex group is only computed once. So if multiple key blocks
are using the same influence vertex group, they'll share the
same exact weights array. This gave around 1.7x speedup in
test chinchilla file which is close enough to if we've been
caching weights permanently in DNA (test machine is dual-code
4 threads laptop).

Some further speed is optimization possible, but it could be
done later as well.

Thanks Brecht for idea of how the things might be solved in
really clear way.
2013-07-31 21:55:25 +00:00
Sergey Sharybin
86cb81abb9 Merging r58756 through r58777 from trunk into soc-2013-depsgraph_mt 2013-07-31 20:49:39 +00:00
Thomas Dinges
3840e0b234 Cycles / Ray Depth:
* Added a Ray Depth output to the Light Path node, which gives the user access to the current bounce.
This can be used to limit the maximum ray bounce on a per shader basis. Another use case is to restrict light influence with this, to have a lamp only contribute to the direct lighting. 

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Light_Path

This is part of my GSoC 2013 project. SVN merge of r58091 and r58772 from soc-2013-dingto.
2013-07-31 20:30:37 +00:00
Joseph Mansfield
c15ae082bb Code cleanup: libmv C API
Clean up inconsistencies in the libmv C API:
- All type identifiers are libmv_TypeName
- All function identifiers libmv_functionName
- Prefer libmv_nounVerb function names (e.g. libmv_featuresDestroy)
- Match Blender code formatting rather than Google
- Spelling corrections

Code review: https://codereview.appspot.com/11494044/
2013-07-31 13:48:12 +00:00
Lukas Toenne
81fd056d61 Fix #36267 part 2 of 2: Fix for reroute node values in old shader node stack system. They were overwriting stack values from their input nodes, because the system would not detect that these sockets
actually just point to existing defined stack values. To make the link check work, set the socket->link pointer if internal node connections exist, this works for both muted and reroute nodes.
2013-07-31 12:26:03 +00:00
Lukas Toenne
3a69398288 Fix #36267, part 1 of 2: fix for reroute node type updates. The reroute nodes change their socket type based on what they are connected to, to work as pass-through nodes with as little conversion as
necessary.

Problem was/is that the nodes can set the 'type' property, but in order to actually change the data type they would also need to update the typeinfo pointer (and idname), which is strongly discouraged.
Solution is to just replace the input/output sockets of the reroute node with new sockets of the desired type and port all links over.
2013-07-31 12:26:01 +00:00
Campbell Barton
43ab02db14 code cleanup: remove redundant NULL checks 2013-07-31 09:18:40 +00:00
Campbell Barton
e129211605 add NULL checks in eyedropper_color_sample_fl since BKE_area_find_region_type may not find a region. 2013-07-31 09:17:58 +00:00
Sergey Sharybin
fc598dbf38 Merging r58747 through r58755 from trunk into soc-2013-depsgraph_mt 2013-07-31 07:34:09 +00:00
Sergey Sharybin
adfc77c1db Use bool instead of int. 2013-07-31 03:44:45 +00:00
Sergey Sharybin
bf6ea3d717 Fix #36302: Multires baking to zero 0 was showing error but still was baking
We do not support baking to level 0, disabled this completely now.
2013-07-31 03:35:45 +00:00
Sergey Sharybin
24b0f8247f Merging r58701 through r58746 from trunk into soc-2013-depsgraph_mt 2013-07-30 19:05:29 +00:00
Sergey Sharybin
61c9c82b62 Use malloc in cases when data is getting overwriten after allocation. 2013-07-30 18:49:40 +00:00
Gaia Clary
f7169cd47d fix: [#36148] Collada instance nodes are not scaled properly during import 2013-07-30 12:18:24 +00:00
Gaia Clary
5c69338fe6 apply world matrix only to armature, Bones and children get it implicit via parenting 2013-07-30 11:10:04 +00:00
Campbell Barton
76e989d7b1 function renaming for own recently added BLI_math functions, suggested by Brecht. 2013-07-30 10:58:36 +00:00
Campbell Barton
298a03ee63 fix for error in own recent changes to transform initialization, proportional editmode needs to skip hidden faces. 2013-07-30 09:50:17 +00:00
Sv. Lockal
793e17ef6c Remove superfluous iterations (caused by typo) and type casts in outliner
This significantly lowers the position of outliner_draw_tree_element in profiler
and partially fixes [#36260] (2,300 Objects Makes Blender Unresponsive)
2013-07-30 08:45:45 +00:00
Gaia Clary
90eec89125 Collada: renamed size_mat to scale_mat for clarity. removed obsolete variable definition 2013-07-30 07:32:37 +00:00
Gaia Clary
8140f56575 Collada: unit converter was not initialized for ArmatureImporter 2013-07-30 07:22:40 +00:00
Mitchell Stokes
620323a12c Missed a couple of files for the vsync commit (r58729). 2013-07-29 22:36:51 +00:00
Mitchell Stokes
29f8dfd37a BGE: Adding vsync control. Users can enable vsync, disable vsync, or use adaptive vsync via UI options in the render properties, or by using the new Python method bge.render.setVsync(). Win32 and X11 support are done via EXT_swap_control. Support for using EXT_swap_control on OS X still needs to be added to Ghost. 2013-07-29 22:31:32 +00:00
Mitchell Stokes
2840edba84 BGE: Adding bge.physics as another alias for the PhysicsConstraints module. 2013-07-29 22:20:06 +00:00
Gaia Clary
a5cc8f2c92 Collada: Optimize Scale to scene. Only need to scale the root objects of a hierarchy 2013-07-29 22:15:04 +00:00
Gaia Clary
1a3a252e06 Collada: Import now always rotates input to match blender's Z_UP axis 2013-07-29 21:51:53 +00:00
Gaia Clary
c8958eea29 Added Scene scale calculator to UnitConverter for future usage (wip) 2013-07-29 21:22:59 +00:00
Gaia Clary
966b301546 Added/changed comment for clarification 2013-07-29 17:27:27 +00:00
Lukas Toenne
b517291fe6 Fix #36264, New modulo math node not viewable in GLSL mode. Modulo math operation was simply missing the switch statement for gpu execution. 2013-07-29 11:42:23 +00:00
Campbell Barton
ac0568d856 fix [#36280] Dynamic Topology crashes with active face 2013-07-29 09:18:35 +00:00
Campbell Barton
1300721d57 add asserts to ensure face normal is up to date. 2013-07-29 09:12:23 +00:00
Campbell Barton
02608d257a add api call for initializing events from the windows eventstate. 2013-07-29 08:29:04 +00:00
Campbell Barton
c9eb93d9fd fix for possible dounle fclose in makesrna's replace_if_different function. 2013-07-29 08:01:12 +00:00
Sergey Sharybin
47e9f0ae76 Added check for address being freed by mempool free
When blender is built in debug mode, BLI_mempool_free will
ensure address passed to the function actually belongs to
this pool.
2013-07-29 06:49:18 +00:00
Sergey Sharybin
a8aafdddf2 Checking unsigned value against >= 0 didn't make sense
Replaced with check of whether there're tasks in the pool
before removing one.
2013-07-29 06:49:11 +00:00
Campbell Barton
cdc315a69b bmesh optimization (noted as todo), avoid recalculating normal every time BM_face_legal_splits() runs,
assume normal is valid (assert when its not).
2013-07-29 06:04:09 +00:00
Campbell Barton
33a9cb6caa minor changes for confusing code.
- memset() was argument was truncated.
- outliner had redundant NULL check.
- node texture was allocating memory to make a unique name which isnt needed for a fixed size string.
2013-07-29 04:45:40 +00:00
Campbell Barton
a25f00301f make code style of makesrna.c conform to the rest of blender, was also some odd indentation for property and struct definitions. 2013-07-29 04:18:01 +00:00
Campbell Barton
9a4b2126a9 rename term 'grid node' --> 'grid division' wtr snapping tips. 2013-07-29 03:01:53 +00:00
Sergey Sharybin
51dab0e0ef Merging r58475 through r58700 from trunk into soc-2013-depsgraph_mt 2013-07-29 02:49:36 +00:00
Campbell Barton
4f02555004 new mesh tool for cleaning up meshes, splits up non-planar faces while they exceed a given angle threshold
(access from the 'Mesh -> Clean' menu).
2013-07-28 19:53:46 +00:00
Campbell Barton
c754eaa0f9 add inline functions getting a single axis from mul_m3_v3() 2013-07-28 19:46:33 +00:00
Campbell Barton
fc4a777511 use '_exec' suffix for operator execute callbacks, also picky change to sizeof() use in BLI_array.h 2013-07-28 17:06:31 +00:00
Campbell Barton
b8e06518c9 add BLI_alloca.h, missed in previous commit 2013-07-28 12:17:00 +00:00
Campbell Barton
1448499d70 patch [#36233] Fix Halo and Billboard Normal and Behavior
from Vitor Balbio (vitorbalbio)

Fixes billboard flipping (flipped normals and textures too)
2013-07-28 12:03:53 +00:00
Campbell Barton
6864f2c285 move suspicious break statement in drawDispListsolid() to prevent falling through. 2013-07-28 11:15:26 +00:00
Campbell Barton
4982f200fa move alloca define into its own header since its not related to BLI_array 2013-07-28 10:38:25 +00:00
Campbell Barton
72f2917032 bmesh: skip error checks when building in release mode (minor speedup),
also more strict use of BLI_array_declare(), only allow after array is declared.
2013-07-28 09:05:27 +00:00
Campbell Barton
b5890b3519 fix for freed memory access clearing tracks in the clip editor. 2013-07-28 07:11:00 +00:00
Campbell Barton
c4a50e9aeb remove unneeded NULL checks, add one for give_matarar() return value. 2013-07-28 06:37:58 +00:00