Commit Graph

130750 Commits

Author SHA1 Message Date
Miguel Pozo 56be404b0f EEVEE-Next: Scene sync fixes and improvements
Rely on the depsgraph to detect scene updates,
using the `view_update` callback.
Remove `SceneHandle` and `scene_sync`.
Remove `reset_recalc_flag`.
Remove most `sampling.reset()` calls and their related logic,
and move the remaining ones to `Instance`.
Re-sync lights on `light_threshold` changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/115758
2023-12-04 15:57:51 +01:00
Philipp Oeser 8bfc412490 Fix #115667: Sculpt face sets draw wrong with subdivision modifier
Copy-paste mistake in 301731692e

Above commit was getting ".sculpt_mask" instead of ".sculpt_face_set"
attribute.

Pull Request: https://projects.blender.org/blender/blender/pulls/115744
2023-12-04 14:43:32 +01:00
Hans Goudey e9f4f8b52a PBVH: Specialize node bounds update, expose functions
Similar to previous commits (7332a1eb90), use three separate
functions for updating the bounds of different PBVH types. This avoids
the use of the vertex iteration macro. Also make the functions reusable,
so they can be called directly after a brush update in the future.
2023-12-04 08:36:02 -05:00
Hans Goudey 869ea79da0 Cleanup: Return PBVH vertex data arrays as spans 2023-12-04 07:55:47 -05:00
Hans Goudey 3b1d5d14f2 Cleanup: Remove unused DMFlagMat struct
Arrays were allocated and filled with data, but never read.
2023-12-04 07:55:47 -05:00
Hans Goudey 8171f719fe Subdiv: Remove unnecessary CCG derived flag structs
The copied the material index and its smoothness to every grid,
resulting in 4 bytes of memory per base mesh face corner. That's
wasteful, since it's trivial to loop up the original data from the base
mesh attributes as necessary. This way we can also avoid the
dereference.
2023-12-04 07:55:47 -05:00
Hans Goudey 5cd6a05f5e Cleanup: Store SubdivCCG in unique_ptr
Automatic memory management and clearer ownership! Requires
removing `MEM_CXX_CLASS_ALLOC_FUNCS` from `MeshRuntime`,
but that's used very inconsistently anyway, and `MeshRuntime` isn't
that large.
2023-12-04 07:55:47 -05:00
Hans Goudey d73868d5a1 Subdiv: Inline grid to face map lookup function
I've seen this appear in profiles sometimes, which it really shouldn't,
since it's just a single array access. I didn't detect an observable
difference, but we don't have to think about that anymore anyway.
2023-12-04 07:55:47 -05:00
Hans Goudey 0b9ae3df4c Subdiv: Use base mesh faces and topology map for SubdivCCG
Instead of storing a redundant array of faces, use the base mesh faces
and corner_to_face map. This saves 8 bytes per base mesh face with
multires sculpting, and avoids recalculating the topology map whenever
reevaluating the object. There is a lot of other duplicate data between
base meshes and faces, particularly in `MeshTopology`. This is just
a first step of untangling that.
2023-12-04 07:55:47 -05:00
Hans Goudey 881ec8b1ed Cleanup: Return multires grid key by value 2023-12-04 07:55:47 -05:00
Hans Goudey a9f847f94c Fix: Various issues with multires visibility undo
Push the undo step before changing any grid hide data, fix a missing
allocation in the undo step, and workaround some issue with temporary
BitVector<> construction that I couldn't quite figure out. Also fix a
crash when there is vertex mask attribute but no multires hiding.
2023-12-04 07:55:47 -05:00
Hans Goudey beda9e4656 Sculpt: Specialize mask fill/invert operator per PBVH type
Two main user-facing benefits: only nodes with actually changed
values have undo steps pushed, meaning reduced memory usage
and undo runtime, and the mask attribute is removed when cleared,
reducing memory usage and theoretically improving performance
afterwards.

On the code side, the changes consist conceptually of expanding the
PBVH vertex iter macro for each PBVH type and simplifying the resulting
logic. This results in significantly more code; the idea is that in the
future abstractions to reduce duplication  will become clearer. We just
want abstractions that relate closely to the actual data processing,
which is much simpler than the existing macro makes it look.
2023-12-04 07:55:47 -05:00
Hans Goudey 7332a1eb90 PBVH: Refactor hide and mask update to be data oriented and reusable
Specialize the mask update for each PBVH type, simplifying hot loops,
reducing reliance on complex shared state and clarifying which data is
used. Expose functions to update the visibility and masks tags for a
specific node. It can be helpful to call these after modifying the data
to update the flags while the data is more likely to be in CPU caches.
2023-12-04 07:55:46 -05:00
Hans Goudey e1c4e7b4c6 Fix: Missing versioning for generic sculpt mask conversion
Since we're always writing the mask with the old format, this versioning
will have to run until a larger breaking release such as 5.0. Luckily it
is cheap, it's just rearranging the pointers to larger arrays.
2023-12-04 07:55:46 -05:00
Hans Goudey f3bfbd9d84 Cleanup: Use const arguments to PBVH functions 2023-12-04 07:55:46 -05:00
Hans Goudey 785c49cf44 Cleanup: Move paint_mask functions to proper namespace
Some of these operators aren't really related to masking
and should be moved elsewhere in the future.
2023-12-04 07:55:46 -05:00
Hans Goudey b74862127d Cleanup: Remove unused arguments to sculpt update function 2023-12-04 07:55:46 -05:00
Pratik Borhade 1020a7f6ee Fix #115704: Crash when using transfer mode on empty space
Caused by missing null check in a7ae024ea3

Pull Request: https://projects.blender.org/blender/blender/pulls/115753
2023-12-04 13:05:57 +01:00
Omar Emara b183a1cd12 Compositor: Disable preview of Split node by default
The Split node had preview enabled after versioning, so disable it by
default.
2023-12-04 13:24:24 +02:00
Omar Emara 771a0cf4e7 Fix: Dangling pointer in Split Viewer versioning
The Split Viewer node storage was freed but not set to nullptr.
2023-12-04 13:23:49 +02:00
Bastien Montagne e617e36b21 I18N: Updated UI translations from git/weblate (55af06d62a579dcae). 2023-12-04 12:17:10 +01:00
Miguel Pozo 210a9ccc2a Fix: EEVEE-Next: Crash when baking multiple volume probes 2023-12-04 12:10:02 +01:00
Jason Fielder 72b6c44e75 Metal: Ensure increased FB attachment count supported
Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/115735
2023-12-04 11:38:15 +01:00
Jeroen Bakker 5dbc276eed Fix: Compiling EEVEE Test cases
Was introduced when BKE_main got a CPP header file.

Pull Request: https://projects.blender.org/blender/blender/pulls/115743
2023-12-04 09:55:48 +01:00
Aras Pranckevicius 19f4f84005 OBJ: add import option to create collection hierarchy by splitting names with a separator
Implements #105001 - new import option for name separator, e.g. "|" or "/".
Names found in the OBJ file are split by that, and a Collection hierarchy is
made, so you can have e.g. "o House/Roof/Tile" in the OBJ file.

Pull Request: https://projects.blender.org/blender/blender/pulls/115742
2023-12-04 09:54:52 +01:00
Jacques Lucke 88ec663498 Cleanup: use more descriptive function names 2023-12-04 09:46:04 +01:00
Campbell Barton be2d940203 Fix error in recent GHOST/Wayland thread priority function
Invalid type for testing was left in making the priority change a noop.
2023-12-04 12:47:15 +11:00
Campbell Barton 92e8b7e850 Cleanup: match logic & naming between bmesh & mesh crazyspace functions 2023-12-04 12:28:44 +11:00
Campbell Barton ad07654ed8 GHOST/Wayland: use minimum priority for helper threads
Wayland threads for event handling & cursor animation shouldn't take
priority over application logic. Set them to minimum priority.
2023-12-04 12:28:43 +11:00
Campbell Barton 3a7c618b87 GHOST/Wayland: animated cursor support
Previously only the first frame of an animated sequence was shown,
now animated cursors are played back as expected
(typically the wait cursor).
2023-12-04 12:28:41 +11:00
Campbell Barton d7492d3b58 Cleanup: minor simplification to internal Wayland cursor API
Avoid passing the 'seat' when the `image` to display can be passed
instead.
2023-12-04 12:28:40 +11:00
Campbell Barton 04cbe2880b Fix error updating the tablets cursor scale on Wayland 2023-12-04 12:28:38 +11:00
Habib Gahbiche 153f14be2b Compositor: Make split viewer a regular split node
Changes:
- Renamed Split Viewer Node to Split Node
- Split Node is now under `Utilities` (similar to Switch node)
- Versioning: split viewer from 4.0 and before is replaced with the new split node connected to a new viewer node.

Pull Request: https://projects.blender.org/blender/blender/pulls/114245
2023-12-03 23:20:44 +01:00
Pratik Borhade b1ac047af4 Cleanup: to_bools comment 2023-12-03 15:41:04 +05:30
Harley Acheson 8933284518 UI: Icons for Area Join and Swap
Icons provided by Alexey Adamitsky to represent screen area join and
screen area swap.

Pull Request: https://projects.blender.org/blender/blender/pulls/115712
2023-12-02 20:08:01 +01:00
Harley Acheson da7128c533 Cleanup: Make format
Formatting changes resulting from Make Format
2023-12-02 11:07:25 -08:00
Hans Goudey ccab01f97f Subdiv: Store multires sculpt grid visibility in BitGroupVector
Instead of allocating a separate bitmap per grid for the hide status, store
all the bits in a recently added C++ data structure that stores all bits in one
contiguous memory chunk. When nothing is hidden, nothing is allocated
(that saves 32 MB for a 16 million vertex multires sculpt). Intuitively it
could have better performance because of the cache benefits of
contiguous memory, but this is hard to measure. It also has a nicer
API than `BLI_bitmap`.

I discussed this with Sergey in person recently. Most of the changes are
just straightforward refactors. The part that isn't is a change to the "show/hide"
operator to structure it similarly to the mesh handling in 4e66769ec0.

Pull Request: https://projects.blender.org/blender/blender/pulls/115687
2023-12-02 20:05:29 +01:00
Bastien Montagne 5736f88e31 BKE main: Add 'merge' utils to merge one Main content into another.
This merge does not rename any ID. In case a conflict happens (an ID of
the same name and library already exists in destination Main), its
counterpart in source Main is not moved, and its usages by other
moved-from-source IDs are remapped accordingly.

Libraries are also properly de-duplicated, and remapped as necessary.

Source Main is always freed by this function, since it is either empty,
or contains left-over IDs very likely to have invalid relationships
after the merge.

NOTE: This commit also enables `main_test.cc` unittests, which was
comitted by mistake in fe3cb11ae4, sorry about that.

Pull Request: https://projects.blender.org/blender/blender/pulls/115671
2023-12-02 16:25:02 +01:00
Bastien Montagne 2064af64e5 BKE lib remap: Add option to allow remapping of `ID.lib` pointers.
Usually Library pointers should not be affected by remapping, but this
can be needed in some cases.

WARNING: Use with caution, this is potentially a dangerous operation for
Main data integrity/validity.
2023-12-02 16:10:41 +01:00
Aras Pranckevicius 854840b35f VSE: speedup "show overexposed" option
Speedup the "apply zebra stripes" image loop by multi-threading it.
For non-float images, avoid an extra image copy that was not doing
anything useful.

4K UHD resolution, Windows Ryzen 5950X:

- LDR: whole `sequencer_get_scope` 16.4ms -> 5.3ms, just `draw_zebra`
  part: 7.5ms -> 3.3ms
- Float image: whole `sequencer_get_scope` 126.6ms -> 114.1ms, just
  `draw_zebra` part: 22.4ms -> 7.4ms. Whole scope is still expensive
  due to color management work being done.

Pull Request: https://projects.blender.org/blender/blender/pulls/115622
2023-12-02 08:09:49 +01:00
Campbell Barton 7aa3d967ba Build: update wayland protocols to 1.32
Adds cursor-shape-v1 which simplifies setting cursors.
2023-12-02 15:42:21 +11:00
Campbell Barton 8bb6d0ffe0 Unbreak building with Vulkan & WITH_GHOST_X11=OFF
Missing from 5b7175c982.
2023-12-02 15:37:10 +11:00
Campbell Barton 5b7175c982 GHOST: remove X11 include when WITH_GHOST_X11=11 2023-12-02 15:27:51 +11:00
Campbell Barton 95f620fd3d Unbreak build with Vulkan+Wayland+X11
GHOST_ContextVK includes `X.h` which defines "None",
rename to "Unset" to avoid naming conflict.
2023-12-02 15:27:22 +11:00
Campbell Barton 4a735b1d05 GHOST/Wayland: use time-stamps from Wayland input
Resolve double-click events not being registered when there was
a delay between event handling.

Address #40009.
2023-12-02 14:58:49 +11:00
Campbell Barton 35295829e4 GHOST/Wayland: improve tablet event handling
Defer creating events until the "frame" callback runs to ensure
the tablet state has been fully updated before the events are created.

This also avoids redundant motion events which are now only sent
when the motion/pressure or tilt callbacks run.
2023-12-02 14:58:49 +11:00
Campbell Barton 32c5ea6262 Cleanup: format 2023-12-02 14:56:12 +11:00
Hans Goudey a7afc5b1e8 Cleanup: Pass PBVH node grid indices as Span 2023-12-01 14:40:14 -05:00
Hans Goudey 380b7c5dc3 Sculpt: Multithread mesh "show all" operation
Continuation of 4e66769ec0. In a test unhiding a small portion
of a 16 million vertex mesh, this halved the time from 10 to 5 ms.
2023-12-01 14:40:14 -05:00
Bastien Montagne 3acb64e7ac BKE_main: move header to be a fully CPP one.
Pull Request: https://projects.blender.org/blender/blender/pulls/115681
2023-12-01 20:38:54 +01:00