19 months agoCycles: Fix rendering of barbershop scene split-kernel-faster-building
Mai Lavelle [Thu, 30 Nov 2017 01:36:53 +0000 (20:36 -0500)]
Cycles: Fix rendering of barbershop scene

19 months agoMerge branch 'master' into split-kernel-faster-building
Mai Lavelle [Tue, 28 Nov 2017 21:58:57 +0000 (16:58 -0500)]
Merge branch 'master' into split-kernel-faster-building

19 months agoCleanup (remove commented OMP directive).
Bastien Montagne [Tue, 28 Nov 2017 15:31:11 +0000 (16:31 +0100)]
Cleanup (remove commented OMP directive).

19 months agoRemoving OMP: BKE's tracking_stabilize.
Bastien Montagne [Tue, 28 Nov 2017 11:38:10 +0000 (12:38 +0100)]
Removing OMP: BKE's tracking_stabilize.

Again, 2 times quicker with BLI than with OMP (from about 5ms to 2.5ms
per frame for the parallelized loop, on a rather small video...).

19 months agoCycles: Fix issue with AO in split kernel_path_background
Mai Lavelle [Tue, 28 Nov 2017 10:46:50 +0000 (05:46 -0500)]
Cycles: Fix issue with AO in split kernel_path_background

Watch out for changes to variables passed by value, these changes
don't persist across the split.

19 months agomakesdna/makesrna: silence output by default
Campbell Barton [Tue, 28 Nov 2017 09:27:40 +0000 (20:27 +1100)]
makesdna/makesrna: silence output by default

No need to print status for basic & reliable operations,
build systems can output operations they run if needed,
or debug output changed in the source if developers are debugging.

Nice for ninja, so any printed text hints at a problem to fix.

19 months agoCycles: Fix build with OSL enabled
Mai Lavelle [Tue, 28 Nov 2017 05:28:04 +0000 (00:28 -0500)]
Cycles: Fix build with OSL enabled

19 months agoFix T53145: bevel tool does not start with amount at zero.
Brecht Van Lommel [Mon, 27 Nov 2017 15:55:27 +0000 (16:55 +0100)]
Fix T53145: bevel tool does not start with amount at zero.

19 months agoCleanup: indentation
Sergey Sharybin [Mon, 27 Nov 2017 15:22:09 +0000 (16:22 +0100)]
Cleanup: indentation

19 months agoRemove workaround for loopcut and DM stability
Sergey Sharybin [Mon, 27 Nov 2017 14:39:32 +0000 (15:39 +0100)]
Remove workaround for loopcut and DM stability

Neither me nor Campbell could redo the issue, lets get rid of this workaround
and fix it properly if still needed.

19 months agoDepsgraph: Make sure unexpected configuration does not happen
Sergey Sharybin [Mon, 27 Nov 2017 13:51:49 +0000 (14:51 +0100)]
Depsgraph: Make sure unexpected configuration does not happen

19 months agoSequencer: Fix missing FX compositor when starting rendering from frame with DoF...
Sergey Sharybin [Mon, 27 Nov 2017 13:24:16 +0000 (14:24 +0100)]
Sequencer: Fix missing FX compositor when starting rendering from frame with DoF disabled

19 months agoSequencer: Add option to render OpenGL preview with DoF
Sergey Sharybin [Fri, 24 Nov 2017 11:19:26 +0000 (12:19 +0100)]
Sequencer: Add option to render OpenGL preview with DoF

The title says it all actually, controlled with DoF check box next to textured
solid check box.

Thanks Campbell for review!

19 months agoRefactor view3d offscreen drawing to avoid having multiple boolean arguments
Sergey Sharybin [Fri, 24 Nov 2017 10:43:16 +0000 (11:43 +0100)]
Refactor view3d offscreen drawing to avoid having multiple boolean arguments

This is fully unreadable to have lots of boolean arguments scattered across the
whole argument list. What does `false, true, true` mean in terms of behavior?

Replace those with bitfield which has advantage of having more human readable

19 months agoCycles: Split shader_eval out of the kernel_lamp_emission kernel
Mai Lavelle [Mon, 27 Nov 2017 07:21:06 +0000 (02:21 -0500)]
Cycles: Split shader_eval out of the kernel_lamp_emission kernel

With this kernels for BWM and classroom scenes are building in half the
time as master. Render times are 1% faster as well.

19 months agoTracking: Cleanup. make code friendly for multi-column editing
Sergey Sharybin [Mon, 27 Nov 2017 07:50:01 +0000 (08:50 +0100)]
Tracking: Cleanup. make code friendly for multi-column editing

19 months agoCycles: Split kernel_path_lamp_emission
Mai Lavelle [Mon, 27 Nov 2017 05:51:05 +0000 (00:51 -0500)]
Cycles: Split kernel_path_lamp_emission

19 months agoCycles: Split indirect_lamp_emission
Mai Lavelle [Mon, 27 Nov 2017 04:46:16 +0000 (23:46 -0500)]
Cycles: Split indirect_lamp_emission

19 months agoCycles: Only use first lamp in indirect_lamp_emission
Mai Lavelle [Mon, 27 Nov 2017 04:34:07 +0000 (23:34 -0500)]
Cycles: Only use first lamp in indirect_lamp_emission

Produces different results when lamps overlap from POV of a ray, but allows
for this function to be split. The differences probably wont be noticeable
in most scenes. Old behavior could be reattained by placing lamps
into the BVH.

19 months agoCycles: Fix mistake with ShaderEvalTask that could lead to crash
Mai Lavelle [Mon, 27 Nov 2017 05:47:24 +0000 (00:47 -0500)]
Cycles: Fix mistake with ShaderEvalTask that could lead to crash

19 months agoCleanup: incorrect comment
Campbell Barton [Mon, 27 Nov 2017 04:15:56 +0000 (15:15 +1100)]
Cleanup: incorrect comment

19 months agoCycles: Merge shadow_blocked_ao and _dl kernels to improve build times
Mai Lavelle [Mon, 27 Nov 2017 02:48:17 +0000 (21:48 -0500)]
Cycles: Merge shadow_blocked_ao and _dl kernels to improve build times

Gives another 4 seconds improvement.

19 months agoCycles: Remove early out that may cause threads to diverge before barrier
Mai Lavelle [Mon, 27 Nov 2017 01:55:59 +0000 (20:55 -0500)]
Cycles: Remove early out that may cause threads to diverge before barrier

19 months agoCleanup: ImageEditor's mask drawing code was re-implementing `BKE_maskrasterize_buffer`!
Bastien Montagne [Sun, 26 Nov 2017 18:18:12 +0000 (19:18 +0100)]
Cleanup: ImageEditor's mask drawing code was re-implementing `BKE_maskrasterize_buffer`!

So this deduplicates and simplifies code, yeah.

Also, as an odd bonus, new code seems slighly quicker than previous one
(about 5 to 10% quicker).

19 months agoRemoving OMP: BKE's mask_rasterize.c
Bastien Montagne [Sun, 26 Nov 2017 18:06:26 +0000 (19:06 +0100)]
Removing OMP: BKE's mask_rasterize.c

Once again nothing much to say here, except that whole mask rendering
process from VSE is about 25% quicker now. ;)

19 months agoRemoving OMP: autotrack BKE code.
Bastien Montagne [Sun, 26 Nov 2017 16:25:41 +0000 (17:25 +0100)]
Removing OMP: autotrack BKE code.

Pretty straightforward this time, we already have a single struct
pointer containing all needed data (or nearly).

And we gain about 10-15% speed on tracking! :)

19 months agoRemoving OMP: bmesh_operators.c
Bastien Montagne [Sun, 26 Nov 2017 14:51:50 +0000 (15:51 +0100)]
Removing OMP: bmesh_operators.c

Two more 'not really useful' cases (OMP only shows some noticeable
speedup with above 1M elements, and since this is quick operation anyway
compared to even ather basic operators, gain is in the 1% area of total
processing time in best case).

So not worth parallelizing here, we'll gain much more on tackling heavy
operations. ;)

And BMesh is free from OMP now!

19 months agoRemoving OMP: bmesh_interp.c
Bastien Montagne [Sun, 26 Nov 2017 12:06:39 +0000 (13:06 +0100)]
Removing OMP: bmesh_interp.c

Performances tests on this one are quite surprising actually...
Parallelized loop itself is at least 10 times quicker with new BLI_task
code than it was with OMP. And subdividing e.g. a heavy mesh with 3
levels of multires (whole process) takes 8 seconds with new code, while
10 seconds with OMP one. And cherry on top, BLI_task code only uses
about 50% of CPU load, while OMP one was at nearly 100%!

In fact, I suspect OMP code was not properly declaring outside vars,
generating a lot of uneeded locks.

Also, raised the minimum level of subdiv to enable parallelization,
tests here showed that we only start to get significant gain with subdiv
levels of 4, below single threaded one is quicker.

19 months agoRemoving OMP: nuke last usages in bmesh_mesh.c
Bastien Montagne [Sun, 26 Nov 2017 10:36:50 +0000 (11:36 +0100)]
Removing OMP: nuke last usages in bmesh_mesh.c

Those three ones were actually giving no significant benefits, in fact
even slowing things down in one case compared to no parallelization at
all (in `BM_mesh_elem_table_ensure()`).

Point being, once more, parallelizing *very* small tasks (like index or
flag setting, etc.) is nearly never worth it.

Also note that we could not easlily use per-item parallel looping in
those three cases, since they are heavily relying on valid
loop-generated index (or are doing non-threadable things like allocation
from a mempool)...

19 months agoFix T53349: AO bounces not working correct with OpenCL.
Mathieu Menuet [Sun, 26 Nov 2017 14:50:36 +0000 (15:50 +0100)]
Fix T53349: AO bounces not working correct with OpenCL.

19 months agoCleanup: rename edge -> edges
Campbell Barton [Sun, 26 Nov 2017 09:13:18 +0000 (20:13 +1100)]
Cleanup: rename edge -> edges

19 months agoCycles: Use ShaderEvalIntent more to pass flag, closures, and eval_task less
Mai Lavelle [Sat, 25 Nov 2017 11:17:03 +0000 (06:17 -0500)]
Cycles: Use ShaderEvalIntent more to pass flag, closures, and eval_task less

This makes it so that path_flag and max_closures are not passed to shader eval
functions, instead a limited number of ShaderEvalIntents are used. This also
removes the need for ShaderEvalTask in the mega kernel and simplifies the
code a bit.

19 months agoMinor improvement to last commit
Campbell Barton [Sun, 26 Nov 2017 07:34:21 +0000 (18:34 +1100)]
Minor improvement to last commit

Don't operate on multiple boundaries at once,
instead keep collapsing from the first selected boundary.

19 months agoBMesh: improve edge rotate when edges share faces
Campbell Barton [Sun, 26 Nov 2017 06:48:00 +0000 (17:48 +1100)]
BMesh: improve edge rotate when edges share faces

Previously outcome depended on order of edges,
now the longest boundary edges are rotated first,
then the faces connected edges.

This gives more predictable results, allowing regions containing
a vertex fan to be rotated onto the next vertex.

19 months agoCleanup: move edge-rotate into own file
Campbell Barton [Sun, 26 Nov 2017 02:40:26 +0000 (13:40 +1100)]
Cleanup: move edge-rotate into own file

19 months agoFix T53393: Change from 'd' key to 'draw' panel button causes pencil to be activated...
Joshua Leung [Sun, 26 Nov 2017 00:05:33 +0000 (13:05 +1300)]
Fix T53393: Change from 'd' key to 'draw' panel button causes pencil to be activated immediately instead of upon LMB

19 months agoFix for Fix (c): broken atomic lock in own bmesh code.
Bastien Montagne [Sat, 25 Nov 2017 22:14:54 +0000 (23:14 +0100)]
Fix for Fix (c): broken atomic lock in own bmesh code.

That was a nasty one, Debug build would never have any issue (even tried
with 64 threads!), but Release build would deadlock nearly immediately,
even with only 2 threads!

What happened here (I think) is that gcc optimizer would generate a
specific path endlessly looping when initial value of virtual_lock was
FLT_MAX, by-passing re-assignment from v_no[0] and the atomic cas
completely. Which would have been correct, should v_no[0] not have been
shared (and modified) by multiple threads. ;)

Idea of that (broken) for loop was to avoid completely calling the
atomic cas as long as v_no[0] was locked by some other thread, but...
Guess the avoided/missing memory barrier was the root of the issue here.

Lesson of the evening: Remember kids, do not trust your compiler to
understand all possible threading-related side effects, and be explicit
rather than elegant when using atomic ops!

Side-effect lesson: do check both release and debug builds when messing
with said atomic ops...

19 months agoFix broken atomic_cas lock in own recent commit in bmesh.
Bastien Montagne [Sat, 25 Nov 2017 19:28:12 +0000 (20:28 +0100)]
Fix broken atomic_cas lock in own recent commit in bmesh.

Using atomic cas correctly is really hairy... ;)

In this case, the returned value from cas needs to validate *two*
conditions, it must not be FLT_MAX (which is our 'locked' value and
would mean another thread has already locked it), but it also must be
equal to previously stored value...

This means we need two steps per loop here, hence using a 'for' loop
instead of a 'while' one now.

Note that collisions are (as expected) very rare, less than 1 for 10k
typically, so did not catch the issue initially (also because I was
mostly working with release build to check on performances...).

19 months agoDepsgraph: Cleanup, indentation
Sergey Sharybin [Fri, 24 Nov 2017 14:45:41 +0000 (15:45 +0100)]
Depsgraph: Cleanup, indentation

19 months agoDepsgraph: Allow finding operations after construction is done
Sergey Sharybin [Fri, 24 Nov 2017 14:37:51 +0000 (15:37 +0100)]
Depsgraph: Allow finding operations after construction is done

19 months agoDepsgraph: Deduplicate operation node finding logic
Sergey Sharybin [Fri, 24 Nov 2017 14:35:42 +0000 (15:35 +0100)]
Depsgraph: Deduplicate operation node finding logic

19 months agoDepsgraph: Use proper return type for find_node method
Sergey Sharybin [Fri, 24 Nov 2017 14:34:53 +0000 (15:34 +0100)]
Depsgraph: Use proper return type for find_node method

19 months agoDepsgraph: Use get_ prefix for function which expect operation to exists
Sergey Sharybin [Fri, 24 Nov 2017 14:32:29 +0000 (15:32 +0100)]
Depsgraph: Use get_ prefix for function which expect operation to exists

19 months agoDepsgraph: Make has_ prefixed function to return boolean
Sergey Sharybin [Fri, 24 Nov 2017 14:26:54 +0000 (15:26 +0100)]
Depsgraph: Make has_ prefixed function to return boolean

19 months agoDepsgraph: Introduce explicit method which finds operation or returns NULL
Sergey Sharybin [Fri, 24 Nov 2017 14:24:33 +0000 (15:24 +0100)]
Depsgraph: Introduce explicit method which finds operation or returns NULL

19 months agoDepsgraph: Make more clear what find_operation() is doing for component
Sergey Sharybin [Fri, 24 Nov 2017 14:21:50 +0000 (15:21 +0100)]
Depsgraph: Make more clear what find_operation() is doing for component

19 months agoCleanup leftover timing debug prints from own recent commits.
Bastien Montagne [Fri, 24 Nov 2017 09:43:29 +0000 (10:43 +0100)]
Cleanup leftover timing debug prints from own recent commits.

Sorry about that...

19 months agoCleanup: -Wnonnull-compare GCC warning
Campbell Barton [Fri, 24 Nov 2017 03:28:35 +0000 (14:28 +1100)]
Cleanup: -Wnonnull-compare GCC warning

19 months agoMinor cleanup for own recent commits.
Bastien Montagne [Thu, 23 Nov 2017 21:43:11 +0000 (22:43 +0100)]
Minor cleanup for own recent commits.

19 months agoGetting rid of OMP: first usage of new parallel BMesh items iteration instead.
Bastien Montagne [Thu, 23 Nov 2017 20:21:32 +0000 (21:21 +0100)]
Getting rid of OMP: first usage of new parallel BMesh items iteration instead.

`BM_mesh_normals_update` was converted from OMP to new parallel iterator code,
basic test with heavily subdivided cube (24.5k faces) gives:
    - old OMP code: average 10ms per run.
    - new BLI_task code: average 6ms per run.

So new code seems to be easily 40% quicker, in addition to getting rid of OMP. ;)

Reviewers: sergey, campbellbarton

Differential Revision:

19 months agoBMesh: add limited support for parallelization over some basic iterators.
Bastien Montagne [Thu, 23 Nov 2017 20:19:54 +0000 (21:19 +0100)]
BMesh: add limited support for parallelization over some basic iterators.

This merely uses new memloop/task looper over vertex/edge/face mempools.

Quite obviously, only BM_VERTS/EDGES/FACES_OF_MESH iterators are

19 months agoatomic_ops: add `atomic_cas_float` helper.
Bastien Montagne [Thu, 23 Nov 2017 20:17:16 +0000 (21:17 +0100)]
atomic_ops: add `atomic_cas_float` helper.

19 months agoAdd a new parallel looper for MemPool items to BLI_task.
Bastien Montagne [Thu, 23 Nov 2017 20:14:43 +0000 (21:14 +0100)]
Add a new parallel looper for MemPool items to BLI_task.

It merely uses the new thread-safe iterators system of mempool, quite
straight forward.

Note that to avoid possible confusion with two void pointers as
parameters of the callback, a dummy opaque struct pointer is used
instead for the second parameter (pointer generated by iteration over
mempool), callback functions must explicitely convert it to expected
real type.

Also added a basic gtest for this new feature.

19 months agoAdd ability to use more than one mempool iterator simultaneously.
Bastien Montagne [Thu, 23 Nov 2017 20:12:00 +0000 (21:12 +0100)]
Add ability to use more than one mempool iterator simultaneously.

This will allow threaded tasks to 'consume' all mempool items in
parallel tasks, each one working on a whole chunk at once (to reduce
concurrency managing overhead).

19 months agoatomic_ops: Copy/adapt static assert macro from BLI_utildefines, and use it.
Bastien Montagne [Thu, 23 Nov 2017 19:18:21 +0000 (20:18 +0100)]
atomic_ops: Copy/adapt static assert macro from BLI_utildefines, and use it.

Checking for type sizes is much nicer with a static assert!

19 months agoAdd non-gcc variant of static assert macro.
Bastien Montagne [Thu, 23 Nov 2017 19:15:15 +0000 (20:15 +0100)]
Add non-gcc variant of static assert macro.

Adapted from

Note that this macro just discards error message, so error when building
is much less nice than with gcc's _Static_assert... But error log will
point to right place in code, so should still be OK.

19 months agoFix T53145: bevel tool fails when used a second time.
Brecht Van Lommel [Thu, 23 Nov 2017 19:14:31 +0000 (20:14 +0100)]
Fix T53145: bevel tool fails when used a second time.

Pixel size was not initial early enough. For first time this was not a problem
because the bevel amount starts at 0 then, and after the mouse moves the pixel
size is initialized. For the second time the bevel amount starts at a non-zero
value, and it failed then.

19 months agoFix T53171: lamp specials strength tweak fails with renamed emission nodes.
Brecht Van Lommel [Thu, 23 Nov 2017 18:13:31 +0000 (19:13 +0100)]
Fix T53171: lamp specials strength tweak fails with renamed emission nodes.

19 months agoFix T53360: crash with GLSL bump mapping and missing group output node.
Brecht Van Lommel [Thu, 23 Nov 2017 17:12:32 +0000 (18:12 +0100)]
Fix T53360: crash with GLSL bump mapping and missing group output node.

19 months agoFix T53276: encoding output quality UI clarification.
Brecht Van Lommel [Thu, 23 Nov 2017 16:55:25 +0000 (17:55 +0100)]
Fix T53276: encoding output quality UI clarification.

19 months agoFix T53357: harmless assert after recent addition of render time pass.
Brecht Van Lommel [Thu, 23 Nov 2017 16:00:18 +0000 (17:00 +0100)]
Fix T53357: harmless assert after recent addition of render time pass.

19 months agoFix inaccuracy when storing material ID pass in half float multilayer EXR.
Brecht Van Lommel [Thu, 23 Nov 2017 15:27:22 +0000 (16:27 +0100)]
Fix inaccuracy when storing material ID pass in half float multilayer EXR.

These and other non-RGB passes should always be stored as full float, the
precision loss is too unpredictable.

Related to T53381, but that one is about file output nodes where we don't
know the type of data being saved currently.

19 months agoFix T53348: Cycles difference between gradient texture on CPU and GPU.
Brecht Van Lommel [Thu, 23 Nov 2017 15:10:38 +0000 (16:10 +0100)]
Fix T53348: Cycles difference between gradient texture on CPU and GPU.

19 months agoMoar attempt to fix bloody MSVC intrinsic mess...
Bastien Montagne [Thu, 23 Nov 2017 15:58:20 +0000 (16:58 +0100)]
Moar attempt to fix bloody MSVC intrinsic mess...

19 months agoAttempt to fix bloody MSVC atomic intrinsic mess...
Bastien Montagne [Thu, 23 Nov 2017 15:53:03 +0000 (16:53 +0100)]
Attempt to fix bloody MSVC atomic intrinsic mess...

19 months agoatomic_ops: add char versions of uint8_t atomic primitives.
Bastien Montagne [Thu, 23 Nov 2017 15:23:45 +0000 (16:23 +0100)]
atomic_ops: add char versions of uint8_t atomic primitives.

19 months agoCleanup: use signed atomic ops when needed.
Bastien Montagne [Thu, 23 Nov 2017 15:14:53 +0000 (16:14 +0100)]
Cleanup: use signed atomic ops when needed.

19 months agoatomic_ops: add signed versions of primitives.
Bastien Montagne [Thu, 23 Nov 2017 15:13:23 +0000 (16:13 +0100)]
atomic_ops: add signed versions of primitives.

Reason is motsly that dealing with type conversion in calling code is
not great, makes it less readable, and can generate hidden bugs in case
original type changes and atomic primitive calls are not updated

19 months agoDepsgraph: Cleanup, deduplicate code around component registration
Sergey Sharybin [Thu, 23 Nov 2017 14:23:19 +0000 (15:23 +0100)]
Depsgraph: Cleanup, deduplicate code around component registration

19 months agoDepsgraph: Cleanup, split build_object() a bit
Sergey Sharybin [Thu, 23 Nov 2017 11:01:31 +0000 (12:01 +0100)]
Depsgraph: Cleanup, split build_object() a bit

19 months agoDepsgraph: Cleanup, always call full `object`
Sergey Sharybin [Thu, 23 Nov 2017 10:39:28 +0000 (11:39 +0100)]
Depsgraph: Cleanup, always call full `object`

19 months agoRevert "BLI_utildefines: Support SWAP macro with two args"
Campbell Barton [Thu, 23 Nov 2017 04:19:24 +0000 (15:19 +1100)]
Revert "BLI_utildefines: Support SWAP macro with two args"

This reverts commit d749320e3b10161430bc4cb7dd92edb63712bf8c.

It's possible the container struct is larger,
we could do sizeof checks that falls back to memmove
but rather avoid complicating things.

19 months agoUse custom SWAP macro for swapping userdef data
Campbell Barton [Thu, 23 Nov 2017 04:18:22 +0000 (15:18 +1100)]
Use custom SWAP macro for swapping userdef data

Avoids complicating the common case

19 months agoFix T53274: Saving template prefs overwrites default prefs
Campbell Barton [Wed, 22 Nov 2017 16:10:58 +0000 (03:10 +1100)]
Fix T53274: Saving template prefs overwrites default prefs

19 months agoBLI_utildefines: Support SWAP macro with two args
Campbell Barton [Wed, 22 Nov 2017 15:44:02 +0000 (02:44 +1100)]
BLI_utildefines: Support SWAP macro with two args

19 months agoWM: minor correction to user-pref writing
Campbell Barton [Wed, 22 Nov 2017 06:11:03 +0000 (17:11 +1100)]
WM: minor correction to user-pref writing

When saving templates had wrong return value.

19 months agoFix T53313: bevel shader with transmission render artifacts.
Brecht Van Lommel [Tue, 21 Nov 2017 23:49:12 +0000 (00:49 +0100)]
Fix T53313: bevel shader with transmission render artifacts.

19 months agoRemoving OMP: get rid of usages in /bmesh/ area.
Bastien Montagne [Tue, 21 Nov 2017 16:55:07 +0000 (17:55 +0100)]
Removing OMP: get rid of usages in /bmesh/ area.

Just removing it, such cases are not bottlenecks and not worth the
complication of doing real threading with own BLI_task.

Other (remaining) usages may be relevant, need case-by-case check.

19 months agoRemoving OMP: get rid of last bit in /editors/ area.
Bastien Montagne [Tue, 21 Nov 2017 16:52:25 +0000 (17:52 +0100)]
Removing OMP: get rid of last bit in /editors/ area.

Just removing it, such cases are not bottlenecks and not worth the
complication of doing real threading with own BLI_task.

19 months agoCleanup: We do not use camel case in Blender code
Sergey Sharybin [Tue, 21 Nov 2017 16:34:44 +0000 (17:34 +0100)]
Cleanup: We do not use camel case in Blender code

At least not for variables.

19 months agoFix T53371: Keying Node fails with values above 1
Sergey Sharybin [Tue, 21 Nov 2017 16:31:45 +0000 (17:31 +0100)]
Fix T53371: Keying Node fails with values above 1

This was expected behavior for over-exposured lamps when the mode was originally
created for Tears of Steel. Turns out, there could be really bad green screen in
real production which will only have green (or rather screen) channel over

Tweaked condition now so we use least bright channel to see if the area has
proper exposure or not.

Seems to work fine in tests, but further tweaks are possible.

19 months agoCycles: Fixed compilation of CUDA kernels. Follow-up fix for my last commit.
Stefan Werner [Tue, 21 Nov 2017 09:43:40 +0000 (10:43 +0100)]
Cycles: Fixed compilation of CUDA kernels. Follow-up fix for my last commit.

19 months agoCycles: Fix OSL brick node after recent fix
Mai Lavelle [Tue, 21 Nov 2017 09:29:31 +0000 (04:29 -0500)]
Cycles: Fix OSL brick node after recent fix

19 months agoCycles: Workaround for performance loss with the CUDA 9.0 SDK.
Stefan Werner [Tue, 21 Nov 2017 09:29:11 +0000 (10:29 +0100)]
Cycles: Workaround for performance loss with the CUDA 9.0 SDK.

CUDA 9.0.176 apparently caused some slow down on high-end Pascal cards that can be mitigated by increasing the number of registers. See for a detailed comparison.

19 months agoFix T53365: OpenCL has wrong shading of brick texture
Mai Lavelle [Tue, 21 Nov 2017 05:38:02 +0000 (00:38 -0500)]
Fix T53365: OpenCL has wrong shading of brick texture

Looks like some weird compiler difference with signed vs unsigned ints.

19 months agoDisable adding scene sequence strips into themselves
Campbell Barton [Tue, 21 Nov 2017 05:33:36 +0000 (16:33 +1100)]
Disable adding scene sequence strips into themselves

D2923 by @spockTheGray w/ edits, see T52586 for details

19 months agoCleanup: redundant ELEM use
Campbell Barton [Tue, 21 Nov 2017 05:14:31 +0000 (16:14 +1100)]
Cleanup: redundant ELEM use

19 months agoCode cleanup: fix harmless compiler warning.
Brecht Van Lommel [Mon, 20 Nov 2017 22:32:06 +0000 (23:32 +0100)]
Code cleanup: fix harmless compiler warning.

19 months agoFix build with OSL 1.9.x, automatically aligns to 16 bytes now.
Brecht Van Lommel [Sat, 18 Nov 2017 05:11:17 +0000 (06:11 +0100)]
Fix build with OSL 1.9.x, automatically aligns to 16 bytes now.

19 months agoCycles: Fix wrong behavior of sharpness in Cubic SSS
Sergey Sharybin [Mon, 20 Nov 2017 10:40:55 +0000 (11:40 +0100)]
Cycles: Fix wrong behavior of sharpness in Cubic SSS

Was giving difference when using sharpness of 1.0 and 0.999 even though the
result was expected to be really close to each other.

This SSS profile will probably be removed in the future in favor of more
physically bases Burley, but for the time being don't see anything wrong
fixing an existing code.

20 months agoFix (unreported) Crash: broken RNA accessors to tesselated MCol data.
Bastien Montagne [Mon, 20 Nov 2017 09:12:21 +0000 (10:12 +0100)]
Fix (unreported) Crash: broken RNA accessors to tesselated MCol data.

Regression from rB823bcf1689a3 (VPaint 2017 GSoC, this is not in 2.79 release).

Also cleanup, using fake-array-ification to access struct members is
generally not a great idea, but when we already have a totally confusing
broken struct layout, this is pure evil, as demonstrated here!

Found while investigating T53341.

20 months agoUV Cube Project: improve default behavior
Campbell Barton [Mon, 20 Nov 2017 08:51:19 +0000 (19:51 +1100)]
UV Cube Project: improve default behavior

- initialize the cube-size from the bounding box when it's not set.
- no longer wrap faces to keep in 0-1 bounds,
  other projection methods don't do this and calculating the scale
  prevents the UV's from being too far outside the view.

20 months agoFix T53342: Outliner 'select hierarchy' broken
Campbell Barton [Mon, 20 Nov 2017 05:01:04 +0000 (16:01 +1100)]
Fix T53342: Outliner 'select hierarchy' broken

Was using cursor position from within menu,
clicking on the same position for every selected item (toggling).

Now operate on each selected outliner element, without toggling.

20 months agoFix T53343: Custom Normal Data Transfer Crashes when some vertexes have no faces.
Bastien Montagne [Sun, 19 Nov 2017 19:42:55 +0000 (20:42 +0100)]
Fix T53343: Custom Normal Data Transfer Crashes when some vertexes have no faces.

Odd nobody noticed this earlier, was obvious bug in code logic here... :/

To be backported to 2.79a.

20 months agoOption not to select with un-hide
Campbell Barton [Sun, 19 Nov 2017 15:28:07 +0000 (02:28 +1100)]
Option not to select with un-hide

D1518 from @mba105 w/ edits

20 months agoCleanup: remove BKE_utildefines
Campbell Barton [Sun, 19 Nov 2017 14:35:49 +0000 (01:35 +1100)]
Cleanup: remove BKE_utildefines

This was meant to be used for less general macros but was never used.


20 months agoFix: Undo pushes were missing for Add/Remove Driver Variable buttons, and Remove...
Joshua Leung [Sun, 19 Nov 2017 14:06:13 +0000 (03:06 +1300)]
Fix: Undo pushes were missing for Add/Remove Driver Variable buttons, and Remove Driver button

20 months agoCleanup - Style
Joshua Leung [Sun, 19 Nov 2017 13:56:40 +0000 (02:56 +1300)]
Cleanup - Style

20 months agoFix T53300: Bone Extrude via Ctrl + Click is not done from active bone tail
Joshua Leung [Sun, 19 Nov 2017 13:55:17 +0000 (02:55 +1300)]
Fix T53300: Bone Extrude via Ctrl + Click is not done from active bone tail

20 months agoFix compiler warning
Joshua Leung [Sun, 19 Nov 2017 13:08:55 +0000 (02:08 +1300)]
Fix compiler warning

--> render_result.c:832 - formal parameter 6 different from declaration