blender.git
2 years agoCycles: Improve denoising speed on GPUs with small tile sizes
Lukas Stockner [Fri, 10 Nov 2017 03:34:14 +0000 (04:34 +0100)]
Cycles: Improve denoising speed on GPUs with small tile sizes

Previously, the NLM kernels would be launched once per offset with one thread per pixel.
However, with the smaller tile sizes that are now feasible, there wasn't enough work to fully occupy GPUs which results in a significant slowdown.

Therefore, the kernels are now launched in a single call that handles all offsets at once.
This has two downsides: Memory accesses to accumulating buffers are now atomic, and more importantly, the temporary memory now has to be allocated for every shift at once, increasing the required memory.
On the other hand, of course, the smaller tiles significantly reduce the size of the memory.

The main bottleneck right now is the construction of the transformation - there is nothing to be parallelized there, one thread per pixel is the maximum.
I tried to parallelize the SVD implementation by storing the matrix in shared memory and launching one block per pixel, but that wasn't really going anywhere.

To make the new code somewhat readable, the handling of rectangular regions was cleaned up a bit and commented, it should be easier to understand what's going on now.
Also, some variables have been renamed to make the difference between buffer width and stride more apparent, in addition to some general style cleanup.

2 years agoFix T53410: 3D Text always recalculated
Campbell Barton [Thu, 30 Nov 2017 06:08:37 +0000 (17:08 +1100)]
Fix T53410: 3D Text always recalculated

2 years agoSelect similar for bones by group index
Campbell Barton [Thu, 30 Nov 2017 03:33:58 +0000 (14:33 +1100)]
Select similar for bones by group index

D2931 by @col-one

2 years agoFix T53420: Vertex Groups: The "-" button gets a hidden function
Bastien Montagne [Wed, 29 Nov 2017 19:19:07 +0000 (20:19 +0100)]
Fix T53420: Vertex Groups: The "-" button gets a hidden function

Guess 'remove all unlocked' is new-ish feature...

To be backported to 2.79a (I think).

2 years agoFix T53116: default texture coordinates for volume materials are blank.
José Luis Oliveira Cunha [Wed, 29 Nov 2017 18:18:04 +0000 (19:18 +0100)]
Fix T53116: default texture coordinates for volume materials are blank.

Differential Revision: https://developer.blender.org/D2935

2 years agoCycles: add object level holdout property.
Brecht Van Lommel [Sat, 18 Nov 2017 05:06:27 +0000 (06:06 +0100)]
Cycles: add object level holdout property.

This works the same as the holdout shader and Z mask layer. Combined with
overrides in 2.8 this is intended to replace the Z mask layer bits.

2 years agoCycles: improve triangle intersection performance.
Maxym Dmytrychenko [Wed, 29 Nov 2017 01:02:17 +0000 (02:02 +0100)]
Cycles: improve triangle intersection performance.

Reduces render time by about 1-2% in benchmark scenes.

Differential Revision: https://developer.blender.org/D2911

2 years agoSequencer: add many more color blend modes, and a new color mix strip.
Maikon Araujo [Mon, 27 Nov 2017 22:33:08 +0000 (23:33 +0100)]
Sequencer: add many more color blend modes, and a new color mix strip.

Differential Revision: https://developer.blender.org/D2872

2 years agoFix paint float color blending bugs with alpha 1.0 and vivid light.
Brecht Van Lommel [Wed, 29 Nov 2017 01:13:37 +0000 (02:13 +0100)]
Fix paint float color blending bugs with alpha 1.0 and vivid light.

For some blend modes there would be no effect with factor 1.0, even if factor
0.999 would give a very different image. Now the result should have no
discontinuity.

Differential Revision: https://developer.blender.org/D2925

2 years agoDepsgraph: Cleanup, use explicit NULL pointer checks
Sergey Sharybin [Wed, 29 Nov 2017 16:55:28 +0000 (17:55 +0100)]
Depsgraph: Cleanup, use explicit NULL pointer checks

3 years agoCleanup: De-duplicate code in object update routines
Sergey Sharybin [Wed, 29 Nov 2017 15:26:16 +0000 (16:26 +0100)]
Cleanup: De-duplicate code in object update routines

3 years agoCleanup: Split depsgraph uber transform function callback
Sergey Sharybin [Wed, 29 Nov 2017 15:22:59 +0000 (16:22 +0100)]
Cleanup: Split depsgraph uber transform function callback

3 years agoCleanup: Remove unused argument
Sergey Sharybin [Wed, 29 Nov 2017 15:14:39 +0000 (16:14 +0100)]
Cleanup: Remove unused argument

3 years agoCleanup: Make object_handle_update easier to follow
Sergey Sharybin [Wed, 29 Nov 2017 15:12:39 +0000 (16:12 +0100)]
Cleanup: Make object_handle_update easier to follow

3 years agoCleanup: Remove unused function
Sergey Sharybin [Wed, 29 Nov 2017 14:59:51 +0000 (15:59 +0100)]
Cleanup: Remove unused function

3 years agoTransform: Avoid use of ob->recalc in snapping code
Sergey Sharybin [Wed, 29 Nov 2017 14:29:39 +0000 (15:29 +0100)]
Transform: Avoid use of ob->recalc in snapping code

Do a direct update of object transform instead, without involving
manual trickery of recalc flag.

Shouldn't be functional changes as far as artists are concerned,
but will allow us to get rid of recalc flags in 2.8.

Thanks Bastien for review!

3 years agoDepsgraph: Fix assert failure
Sergey Sharybin [Wed, 29 Nov 2017 13:58:37 +0000 (14:58 +0100)]
Depsgraph: Fix assert failure

3 years agoCleanup: rename bpy_util -> bpy_capi_utils
Campbell Barton [Wed, 29 Nov 2017 10:11:29 +0000 (21:11 +1100)]
Cleanup: rename bpy_util -> bpy_capi_utils

This is for internal CAPI use only, avoid confusion w/ bpy.utils module.

3 years agoCleanup: Python imports
Campbell Barton [Wed, 29 Nov 2017 07:00:41 +0000 (18:00 +1100)]
Cleanup: Python imports

Split over lines to diff more easily.

3 years agoPyAPI: add function to check any mathutils type
Campbell Barton [Wed, 29 Nov 2017 05:09:46 +0000 (16:09 +1100)]
PyAPI: add function to check any mathutils type

Also add CheckExact versions of type checking macros.

3 years agoRNA: sync API changes from 2.8
Campbell Barton [Wed, 29 Nov 2017 03:09:49 +0000 (14:09 +1100)]
RNA: sync API changes from 2.8

3 years agoRNA: Allow structs to define tags for their properties
Julian Eisel [Wed, 29 Nov 2017 02:52:06 +0000 (13:52 +1100)]
RNA: Allow structs to define tags for their properties

Adds support for defining a number of tags as part of the rna-struct
definition, which its properties can set similar to property-flags.
BPY supports setting these tags when defining custom properties too.

* To define tags for a struct (which its properties can use then), define the tags in an `EnumPropertyItem` array, and assign them to the struct using `RNA_def_struct_property_tags(...)`.
* To set tags for an RNA-property in C, use the new `RNA_def_property_tags(...)`.
* To set tags for an RNA-property in Python, use the newly added tags parameter. E.g. `bpy.props.FloatProperty(name="Some Float", tags={'SOME_TAG', 'ANOTHER_TAG'})`.

3 years agoPyAPI: PyC_Err_PrintWithFunc utility function
Campbell Barton [Wed, 29 Nov 2017 02:41:10 +0000 (13:41 +1100)]
PyAPI: PyC_Err_PrintWithFunc utility function

Move function error printing utility into py_capi_utils.

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

3 years 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...).

3 years 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.

3 years 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.

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

3 years 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.

3 years 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

3 years 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

3 years 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!

3 years 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
meaning.

3 years 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

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

3 years 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).

3 years 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. ;)

3 years 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! :)

3 years 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!

3 years 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.

3 years 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)...

3 years 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.

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

3 years 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.

3 years 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.

3 years 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

3 years 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

3 years 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...

3 years 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...).

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

3 years 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

3 years 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

3 years 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

3 years 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

3 years 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

3 years 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

3 years 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

3 years 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...

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

3 years 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.

3 years 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: https://developer.blender.org/D2930

3 years 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
supported.

3 years 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.

3 years 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.

3 years 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).

3 years 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!

3 years 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 http://www.pixelbeat.org/programming/gcc/static_assert.html.

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.

3 years 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.

3 years 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.

3 years 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.

3 years 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.

3 years 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.

3 years 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.

3 years 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.

3 years 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...

3 years 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...

3 years 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.

3 years 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.

3 years 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
accordingly...

3 years 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

3 years 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

3 years 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`

3 years 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.

3 years 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

3 years 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

3 years 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

3 years 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.

3 years 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.

3 years 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.

3 years 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.

3 years 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.

3 years 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
exposured.

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.

3 years 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.

3 years 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

3 years 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 https://developer.blender.org/F1142667 for a detailed comparison.

3 years 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.

3 years 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

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

3 years 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.

3 years 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.