Commit Graph

120055 Commits

Author SHA1 Message Date
Lukas Tönne
227a4eae77 Make ImplicitSharingPtr constructor from data pointer explicit
The ImplicitSharingPtr has an implicit constructor for raw pointers.
This has unintended effects when comparing an ImplicitSharingPtr to a
raw pointer: The raw pointer is implicitly converted to the shared
pointer (without change in refcount) and when going out of scope will
decrement user count, eventually freeing the data.

Conversion from raw pointer to shared pointer should not happen
implicitly. The constructor is made explicit now. This requires a little
more boilerplate when constructing a sharing pointer. A special
constructor for the nullptr is added so comparison with nullptr can
still happen without writing out a constructor.

Pull Request: https://projects.blender.org/blender/blender/pulls/115476
2023-11-27 15:53:29 +01:00
Jacques Lucke
cf9987d548 Cleanup: remove line accidentally added in previous commit 2023-11-27 15:24:23 +01:00
Jacques Lucke
d46770703a Fix: assert when randomizing mesh with zero faces 2023-11-27 15:20:53 +01:00
Hans Goudey
eb399678f5 Fix #115366: Missing task isolation subdividing loose edges
Nowadays we have the loose edge cache which can tell us if there will be
any loose edges to subdivide. This means the topology map creation that
included multi-threading doesn't need to be behind a lock anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/115480
2023-11-27 15:19:44 +01:00
Falk David
3a743018b1 Fix: GPv3: Wrong location in paint_init_pivot
The `paint_init_pivot` calculates the `location` based
on the midpoint of the bounds of the object. For grease pencil
the bounds depend on the current frame (for original data).

This fixes the issue by making the `bounds_min_max` function
dependent on the `frame` and by introducing a `bounds_min_max_eval`
for evaluated data.
2023-11-27 15:06:38 +01:00
Falk David
8dc9a9a0e3 Fix: GPv3: Uninitialized runtime variable
The `eval_frame` was not initialized to a default value,
causing a crash in some situations on windows.
This at least avoids a crash even if the outcome of
whatever uses the `eval_frame` might not be correct.
2023-11-27 15:06:38 +01:00
Miguel Pozo
fe90c82b20 EEVEE-Next: Fix ObjectHandle::recalc
Implement the EEVEE side of #114112.
Use ObjectRuntime::last_update to compute the ObjectHandle::recalc
flags.

Fix #114135
Fix #114696
Fix #114170

Pull Request: https://projects.blender.org/blender/blender/pulls/115243
2023-11-27 12:23:18 +01:00
Jeroen Bakker
8ae80abe5f Fix: Various Small GLSL Material Tweaks
We should use explicit casting. Although it is not always needed it
is a best practise in order to support the shaders on Metal.

* `float max(float, int)` is not supported on Metal and fails with a compilation error

Pull Request: https://projects.blender.org/blender/blender/pulls/115464
2023-11-27 12:06:28 +01:00
Miguel Pozo
78de9138e5 Core: Add ObjectRuntime::last_update transform, geometry and shading
Track the last time an object or its dependencies were evaluated by the
dependency graph.
These values can be compared against DEG_get_update_count().
Implemented following the design from #114112

Pull Request: https://projects.blender.org/blender/blender/pulls/115196
2023-11-27 12:03:17 +01:00
Jason Fielder
9042773d93 GPU: Resolve compilation error in Metal caused by type ambiguity
Recent change in commit 3f778150a9
caused compilation errors in Metal due to type ambiguity. Updating call to
explicitly utilise floats where appropriate.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115301
2023-11-27 11:50:25 +01:00
Bastien Montagne
d293f72ab6 Fix typo in UI message. 2023-11-27 11:28:00 +01:00
Jacques Lucke
d34618e6b4 Geometry Nodes: muting zone input and output nodes is not allowed 2023-11-27 10:23:40 +01:00
Jacques Lucke
f8c8878232 Fix #115451: hard to resize collapsed nodes
Caused by 74dd1e044b.
2023-11-27 10:14:49 +01:00
Jeroen Bakker
53ebe40ed2 Fix: EEVEE Compiler Issue Emission Shader
Due to recent changes the local variables where not explicitly cast, that failed
when compiling on Metal.

Pull Request: https://projects.blender.org/blender/blender/pulls/115463
2023-11-27 08:46:23 +01:00
Habib Gahbiche
46131a6813 Cleanup: silence warning inconsistent-missing-override
Silence warning `'call' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]`

Pull Request: https://projects.blender.org/blender/blender/pulls/115440
2023-11-27 08:01:12 +01:00
Hans Goudey
d1a3108fa2 Fix #115291: Object dimension setting ignores modifiers
The factor needs to be calculated against the evaluated bounds rather
than the bounds of the original geometry. Error in 1cbd0f5a85.
2023-11-26 23:09:29 -05:00
Hans Goudey
b022457bfe Cleanup: Use attribute propagation utility function in fillet curves
Using a shared type-agnostic attribute propagation function gives a 32
KB reduction in binary size with no observable performance difference.
2023-11-26 20:51:47 -05:00
Harley Acheson
ce5305451c Fix #115444: Revert "Refactor: Text Editor Formatted Output"
This reverts commit fe50189193.

Pull Request: https://projects.blender.org/blender/blender/pulls/115458
2023-11-27 01:41:26 +01:00
Campbell Barton
89fd0d0537 Fix uninitialized use_scene_unit for STL export 2023-11-27 10:59:54 +11:00
Campbell Barton
4e10a4f635 Cleanup: various C++ updates from C 2023-11-27 10:59:54 +11:00
Campbell Barton
1eff48a838 Cleanup: spelling in code 2023-11-27 10:55:39 +11:00
Campbell Barton
27c660707d Cleanup: spelling in comments, variables 2023-11-27 09:54:36 +11:00
Campbell Barton
e084553e88 Cleanup: add missing include 2023-11-27 09:31:37 +11:00
Campbell Barton
343b48663b Cleanup: format 2023-11-27 09:30:52 +11:00
Campbell Barton
c7ead98d4e License headers: add SPDX copyright entries 2023-11-27 09:27:52 +11:00
Iliya Katueshenock
86b1d6de34 Cleanup: formatting
Pull Request: https://projects.blender.org/blender/blender/pulls/115377
2023-11-26 14:20:41 +01:00
Habib Gahbiche
9cc038f580 Fullframe compositor: unify behavior of size inference with realtime-compositor
Make size inference consistent with the viewport compositor (from a user's perspective). This patch uses constat folding to create a constant output out of constant inputs. This is consistent with the results of the realtime compositor.

Nodes not included in this patch require further refactoring or discussion. They will be addressed in future patches.

Pull Request: https://projects.blender.org/blender/blender/pulls/114755
2023-11-26 12:14:35 +01:00
Pratik Borhade
b0cb58ca0e Fix #115368: Auto smooth node is added every time if the file has linked object
To avoid this, clear `ME_AUTOSMOOTH_LEGACY` flag once auto-smooth node is
added to object from legacy files.

Pull Request: https://projects.blender.org/blender/blender/pulls/115394
2023-11-26 07:14:44 +01:00
Ray Molenkamp
1b6cd937ff Cleanup: CMake: Modernize bf_imbuf dependencies
Pretty straightforward

- Remove any bf_imbuf paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115425
2023-11-25 23:37:24 +01:00
Ray Molenkamp
6b70c04724 Cleanup: CMake: Modernize bf_depsgraph dependencies
Pretty straightforward

- Remove any bf_depsgraph paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115422
2023-11-25 22:51:59 +01:00
Jacques Lucke
74dd1e044b Nodes: improve socket picking tolerances
The goal here is to make it easier to make node links. Previously, it was quite
easy to accidentally start box selection or to trigger the link-drag-search when
that was not intended.

Now, the tolerances are a bit easier to work with. Also, instead of trying to use
the first socket that is close enough, it will find the closest socket instead. It feels
much better in my testing already, but obviously the values can be tuned more
with some testing.

Also we have to make sure to not accidentally make other things like resizing
nodes harder.

Pull Request: https://projects.blender.org/blender/blender/pulls/115010
2023-11-25 15:23:31 +01:00
Germano Cavalcante
cea7b0bde8 Fix #115393: Set Snap Base not working
Caused by 07b5e1bd80

Error in the early return logic.
2023-11-25 09:49:17 -03:00
Iliya Katueshenock
361174b588 Refactor: GEO: Mesh selection header file
Share code of geometry processing of mesh selection.
For now, `mesh_copy_selection` is only user of this code,
but in #115142 this will also be used.

Pull Request: https://projects.blender.org/blender/blender/pulls/115376
2023-11-25 13:41:17 +01:00
Leon Schittek
42ddc13033 Fix #95709: Improve pulldown menu corner rounding
Improve corner rounding of menus and popup blocks.

Pull Request: https://projects.blender.org/blender/blender/pulls/111554
2023-11-24 23:55:43 +01:00
Leon Schittek
0335b6a3b7 UI: Improve menu dropshadow
Improvements to the drawing of shadows, used with blocks, menus, nodes,
etc. Improvements to shape, especially at the top corner or at extremes
of widget roundness. Allows transparent objects to have shadows. This
is a nice refactor that removes a lot of code.

Pull Request: https://projects.blender.org/blender/blender/pulls/111794
2023-11-24 22:50:20 +01:00
Harley Acheson
0370feb1bf Anim: Marker Drawing Changes
Don't draw marker line through marker. Draw Selected markers in a color
that matches selected line and text.

Pull Request: https://projects.blender.org/blender/blender/pulls/115252
2023-11-24 19:19:31 +01:00
Brecht Van Lommel
0da822e471 Refactor: improve (still unused) UV unwrap simplify code
Use vector instead of malloc, make cost function a callback, tweak names
and comments for clarity.
2023-11-24 19:13:51 +01:00
Brecht Van Lommel
c1f931a399 Cleanup: default initialize members of ParamHandle 2023-11-24 19:13:51 +01:00
RedMser
bf97bc634f Fix: remove leading space in window title
Remove leading space in window title for saved files.

Pull Request: https://projects.blender.org/blender/blender/pulls/114704
2023-11-24 18:57:09 +01:00
Ray Molenkamp
ae25298774 Cleanup: CMake: Modernize bf_blenfont dependencies
Pretty straightforward

- Remove any bf_blenfont paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115365
2023-11-24 18:29:09 +01:00
Ray Molenkamp
b683bcc46c Cleanup: CMake: Modernize bf_intern_clog dependencies
Pretty straightforward

- Remove any bf_intern_clog paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115323
2023-11-24 17:12:24 +01:00
Clément Foucault
b607c8677a Fix #114151: Workbench: Assert with volume and thumbnail rendering
This is caused by some path not setting the proper usage flag
on the main depth stencil texture making impossible to use
stencil view of this texture.

Make this flag mandatory for offscreen buffer fixes the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/115361
2023-11-24 16:52:21 +01:00
Bastien Montagne
ecb0d25c6f Assets: RNA: Add RNA struct for 'AssetWeakReference' data.
Note: Everything here is read-only, this is expected to be used as
testing/validating/debug info access for the time being, not as an
actual way to edit data.
2023-11-24 15:30:56 +01:00
Christoph Lendenfeld
a65cd72479 Fix: Segfault when inserting keyframes
`action_fcurve_ensure` can be passed a nullptr for
the PointerRNA, which the function didn't check for
after the refactor.
2023-11-24 15:28:20 +01:00
Bastien Montagne
9c2330d821 Assets: Cleanup/deduplicate usages of RNA enum for asset lib types.
The same data was essentially defined twice.

Pull Request: https://projects.blender.org/blender/blender/pulls/115353
2023-11-24 15:25:25 +01:00
Jeroen Bakker
ec772ed2f1 Vulkan: Timeline Semaphores
This change adds timeline semaphores to track submissions. The previous
implementation used a fence.

Timeline semaphores can be tracked in more detail as it is an counter.
For each submission the counter can be stored locally and when waiting
for completion the counter can be retrieved again and checked if is
known to be succeeded by a higher value.

The timeline semaphore is stored next to the queue and can also be used
to synchronize between multiple contexts.

Pull Request: https://projects.blender.org/blender/blender/pulls/115357
2023-11-24 15:23:46 +01:00
Jason Fielder
18f7d158fe GPU: cleanup texture view usage flags
Texture usage flag `GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW`
was originally implemented and used too conservatively for many
cases in which the underlying API flags were not required.

Renaming to `GPU_TEXTURE_USAGE_FORMAT_VIEW` to reflect
the only essential use case for when a texture view is initialized with
a different texture format to the source texture. Texture views can
still be created without this flag when mip range or base level is
adjusted,

This flag is still required by stencil views and internally by the Metal
backend for certain feature support such as SRGB render toggling.

Patch also includes some small changes to the Metal backend to
adapt to this new compatibility and correctly capture all texture view
use-cases.

Related to #115269

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/115300
2023-11-24 15:21:00 +01:00
Bastien Montagne
e14c9552c3 Liboverride: Refactor 'refresh' tagging and handling.
Move tagging from `flush_editors_id_update` to `deg::id_tag_update`.

Since ID relationships cannot always be trusted when tagging for update
happens (can happen e.g. during liboverride apply itself, when deleting
IDs, and so on), embedded IDs are simply tagged here too, instead of
directly tagging their owner ID.

Propagation from embedded to owner ID then happens when checking and
'consuming' the `LIB_TAG_LIBOVERRIDE_AUTOREFRESH` ID tag, in
`BKE_lib_override_library_main_operations_create`.

Pull Request: https://projects.blender.org/blender/blender/pulls/115319
2023-11-24 14:51:30 +01:00
Jeroen Bakker
d09d93febf Vulkan: Store Vertex, Index and Storage Buffers on Device Memory
Currently all buffer types were stored in host memory, which is visible to the GPU as well.
This is typically slow as the data would be transferred over the PCI bus when used.

Most of the time Index and Vertex buffers are written once and read many times so it makes
more sense to locate them on the GPU. Storage buffers typically require quick access as they
are created for shading/compute purposes.

This PR will try to store vertex buffers, index buffers and storage buffers on device memory
to improve the performance.

Uniform buffers are still located on host memory as they can be uploaded during binding process.
This can (will) reset the graphics pipeline triggering draw calls using unattached resources.

In future this could be optimized further as in:
* using different pools for allocating specific buffers, with a fallback when buffers cannot be
  stored on the GPU anymore.
* store uniform buffers in device memory

Pull Request: https://projects.blender.org/blender/blender/pulls/115343
2023-11-24 13:52:48 +01:00
Clément Foucault
ab7505c7ce EEVEE-Next: Disable distant light if world contains absorption
This restrict the usage of distant light if the world shader
contains absorption phenomenon.

Why this is needed is described in #114062.

At the same time, this removes the parameter for enabling
volume light as this is now an auto-detected optimization.

This also contains a few small cleanups.

Pull Request: https://projects.blender.org/blender/blender/pulls/115284
2023-11-24 13:51:07 +01:00