Commit Graph

75472 Commits

Author SHA1 Message Date
Sergey Sharybin
9e658b5ebc 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.
2017-11-27 15:52:02 +01:00
Sergey Sharybin
5191104776 Depsgraph: Sanitize placement of component types in switch statement
Makes it more clear why and what is being ignored.
2017-11-27 15:34:36 +01:00
Sergey Sharybin
488b6fa669 Merge branch 'master' into blender2.8 2017-11-27 14:52:31 +01:00
Sergey Sharybin
e3f2b1676c Depsgraph: Make sure unexpected configuration does not happen 2017-11-27 14:51:49 +01:00
Sergey Sharybin
f54e076ae6 Merge branch 'master' into blender2.8 2017-11-27 14:32:19 +01:00
Sergey Sharybin
ef439a1f7e Sequencer: Fix missing FX compositor when starting rendering from frame with DoF disabled 2017-11-27 14:24:16 +01:00
Sergey Sharybin
408515810e Merge branch 'master' into blender2.8 2017-11-27 14:08:35 +01:00
Sergey Sharybin
9b42b3e114 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!
2017-11-27 12:21:21 +01:00
Sergey Sharybin
37fc23dd9e 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.
2017-11-27 12:11:56 +01:00
Sergey Sharybin
ff9cf06645 Tracking: Cleanup. make code friendly for multi-column editing 2017-11-27 08:50:01 +01:00
Campbell Barton
3bd6c8bfa2 WM: don't change selection on workspace append 2017-11-27 18:40:09 +11:00
Campbell Barton
d4161845b2 Tool System: show manipulators at startup
Support duplicating, switching workspaces too.
2017-11-27 18:36:54 +11:00
Campbell Barton
ee99d1453a Fix crash duplicating workspace 2017-11-27 17:24:26 +11:00
Campbell Barton
885e73d387 Manipulator: ignore depth-buffer for scale cage 2017-11-27 15:51:18 +11:00
Campbell Barton
7b8e89f297 Cleanup: incorrect comment 2017-11-27 15:15:56 +11:00
Campbell Barton
46d9c5de84 WM: handle widgets before tool keymaps
Allows adjusting on-screen widgets even when a tool is selected.
2017-11-27 15:10:33 +11:00
Bastien Montagne
de09366d57 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/mask/mask_draw.c
2017-11-26 20:29:56 +01:00
Bastien Montagne
440aa2bf70 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).
2017-11-26 19:18:12 +01:00
Bastien Montagne
06e64058dd 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. ;)
2017-11-26 19:06:26 +01:00
Bastien Montagne
440a49a24c 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! :)
2017-11-26 17:25:41 +01:00
Bastien Montagne
f1ce279903 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!
2017-11-26 16:03:29 +01:00
Bastien Montagne
2b6f345558 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.
2017-11-26 16:03:29 +01:00
Bastien Montagne
099bda8875 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)...
2017-11-26 16:03:29 +01:00
Campbell Barton
311da4cd16 Cleanup: rename edge -> edges 2017-11-26 20:13:18 +11:00
Campbell Barton
23252eece6 Minor improvement to last commit
Don't operate on multiple boundaries at once,
instead keep collapsing from the first selected boundary.
2017-11-26 18:38:45 +11:00
Campbell Barton
329bf8e1bf 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.
2017-11-26 17:51:22 +11:00
Campbell Barton
5b225c59bb Cleanup: move edge-rotate into own file 2017-11-26 13:42:25 +11:00
Joshua Leung
941deaca7a Fix T53393: Change from 'd' key to 'draw' panel button causes pencil to be activated immediately instead of upon LMB 2017-11-26 13:06:16 +13:00
Bastien Montagne
3c1f3c02c6 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...
2017-11-25 23:14:54 +01:00
Bastien Montagne
dd6c918b2c 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...).
2017-11-25 20:28:12 +01:00
Clément Foucault
9aece5e1e7 Eevee: Fix Defered AO defines 2017-11-25 17:47:52 +01:00
Clément Foucault
0c4740735c Eevee: Fix SSS mixing with transparent bsdf 2017-11-25 17:47:52 +01:00
Clément Foucault
5dfeecf47b Eevee: Add SSS support in probes
Previously the lighting of SSS material was not present in reflection probe or irradiance grid.

This does not compute the SSS correctly but at least output the corresponding irradiance power to the correct output.
2017-11-25 17:47:52 +01:00
Julian Eisel
974ffaa39d Get workspace mode from the workspace view-layer
While this probably isn't the final solution we'll go with, it's nicer
as current one, which was basically broken. So consider this as
temporary solution.

It also allows testing how changing workspace changes mode & active
object, but only by having the workspaces use different view-layers.

Decided to remove WorkSpace.mode for now. If we need to bring it back,
we'll have to version patch it anyway.
2017-11-25 03:42:49 +01:00
Clément Foucault
7cbc7dd904 Eevee: SSS: Add separated Albedo option.
This option prevent from automatically blurring the albedo color applied to the SSS.

While this is great for preserving details it can bleed more light onto the nearby objects since the blurring will be done on pure "white" irradiance.
This issue is to be tackled in a separate commit.
2017-11-24 22:29:28 +01:00
Clément Foucault
8d4aa6bf44 GPUFramebuffer: Bump the framebuffer attachement limit to 5 color textures 2017-11-24 22:29:28 +01:00
Sergey Sharybin
8a1a053250 Depsgraph: Tag background scene for base flags update
When setting background object, it might pull new objects in and those objects
will not have proper flags unless on_visible_update() was called afterwards.
2017-11-24 16:55:33 +01:00
Sergey Sharybin
6130524d8c Revert "Depsgraph: Remove legacy re-scheduling code"
This reverts commit 90ff88646d.

Can not do this yet, if object is not part of graph yet it will not have entry
taq. Need some more generic solution here.
2017-11-24 16:44:54 +01:00
Sergey Sharybin
d211c36c83 Depsgraph: Allow tagging whole scene for base flags flush 2017-11-24 16:34:06 +01:00
Sergey Sharybin
20c8c9a3c7 Depsgraph: make it more obvious who's view layer is being updated 2017-11-24 16:33:21 +01:00
Sergey Sharybin
a1500fe865 Depsgraph: Do log from newly base flag flush function 2017-11-24 16:07:38 +01:00
Sergey Sharybin
90ff88646d Depsgraph: Remove legacy re-scheduling code 2017-11-24 15:46:25 +01:00
Sergey Sharybin
3023eb384a Depsgraph: Fix crash when deleting object which is linked both directly and indirectly 2017-11-24 15:46:25 +01:00
Sergey Sharybin
71febcbae0 Depsgraph: Make code a bit more robust against tagging indirectly linked objects 2017-11-24 15:46:25 +01:00
Sergey Sharybin
a365f1dd65 Depsgraph: Re-schedule pending tags after relations update
It is possible to have situation when we need to both update relations and do
some updates on random IDs. This was only done before for objects using their
recalc field. This means, every update tag which did not fit into there would
have been lost after updating relations.

Now we do some smarter re-scheduling of operations after relations are updated.
2017-11-24 15:46:25 +01:00
Sergey Sharybin
dde05cbcc2 Depsgraph: Directly linked objects should be priority for base flags over set scenes 2017-11-24 15:46:25 +01:00
Sergey Sharybin
ad288c9c34 Depsgraph: Fix race condition when object is coming from both scene and set 2017-11-24 15:46:25 +01:00
Sergey Sharybin
33b8a3f9e8 Depsgraph: Pass base in relations builder 2017-11-24 15:46:25 +01:00
Sergey Sharybin
272da2790b Depsgraph: Correct wrong base_flags for objects coming from set scene 2017-11-24 15:46:25 +01:00
Sergey Sharybin
81324dbfbf Depsgraph: Use proper link flag for indirectly linked parent object 2017-11-24 15:46:25 +01:00