Commit Graph

129257 Commits

Author SHA1 Message Date
Jacques Lucke
71feaba657 RNA: speedup rna path creation in simple but common case
This speeds up saving the following production file by about 10%:
`240ms -> 220ms`
`heist/pro/shots/060_fight/060_0080/060_0080.anim.blend`

This is a fairly low hanging fruit. Ideally we wouldn't have to duplicate
the string at all, but changing that is a larger undertaking.
2023-10-13 18:42:23 +02:00
Clément Foucault
5b1d5fa82f Cleanup: EEVEE-Next: Remove some TODOs
These just move some code around, cleanup the
syntax and make sure to use appropriate libs.
2023-10-13 18:33:15 +02:00
Clément Foucault
ef494b2794 Fix EEVEE-Next: Broken Barycentric on Metal 2023-10-13 18:01:29 +02:00
Clément Foucault
71dfcf4558 EEVEE-Next: Remove common lib usage
Replaces all usage by the the gpu_shader_math
equivalent. This is because the old shader
library was quite tangled.

This avoids dependency hell trying to
mix libraries.

Changes are split into isolated commits until
I had to do mass changes because of inter-
dependencies.

Pull Request: https://projects.blender.org/blender/blender/pulls/113631
2023-10-13 17:59:46 +02:00
Harley Acheson
f7a8536112 Merge branch 'blender-v4.0-release' 2023-10-13 08:36:19 -07:00
Harley Acheson
a9dc7a4719 Cleanup: Comment for Assert in UI_text_clip_middle_ex
Just an added detailed comment for the reason for the assert in
UI_text_clip_middle_ex and why it has wriggle room.
2023-10-13 08:35:04 -07:00
Miguel Pozo
42aa97a080 Fix #113580: Workbench: Always setup in_front_depth_tx
Always setup in-front depth, since Overlays can be updated without causing a Workbench re-sync.
2023-10-13 17:12:40 +02:00
Dalai Felinto
4a11755458 GPv3: Curve to Mesh node
Part of #113602.
Ref !113659.
2023-10-13 16:50:12 +02:00
Falk David
1b85ca7b05 Fix: GPv3: Reorder layers missing update
Reordering layers using drag-and-drop in the properties editor
was missing a depsgraph update.
2023-10-13 16:48:43 +02:00
Clément Foucault
f4e584b02a BLI: Math Vector: Add reduce_min/max/add and average function
This is a straightforward port from Cycles functions.

They are written to work even with vector of size 1.

Pull Request: https://projects.blender.org/blender/blender/pulls/113678
2023-10-13 16:48:19 +02:00
Brecht Van Lommel
7f07d5f428 Merge branch 'blender-v4.0-release' into main 2023-10-13 16:34:27 +02:00
Dalai Felinto
1f680c3859 GPv3: Curve to Points node
Part of #113602.
Ref !113634.
2023-10-13 16:33:54 +02:00
Dalai Felinto
6853d787db Geometry Nodes: Util function to propagate attributes
This propagates from layer to instances, which is required by some
of the Grease Pencil nodes.

Part of #113602.
Ref !113634.
2023-10-13 16:33:54 +02:00
Brecht Van Lommel
5e67e44963 Shaders: don't unnecessarily set subsurface scale to zero in old files
When the subsurface weight is zero, keep the scale to its default value.
2023-10-13 16:32:19 +02:00
Clément Foucault
51f37be0cd EEVEE-Next: Make renderpass lib mandatory for nodetree evaluation
This is to avoid broken materials if they include a AOV node.
This doesn't mean that it adds render passes resources to
every shader.
2023-10-13 16:23:07 +02:00
Dalai Felinto
4250ae7df8 GPv3: Fix Curve Fill node
We were replacing all the instances inside the loop that iterate
over the instances themselves.

Ref: !113676
2023-10-13 16:19:04 +02:00
Julian Eisel
6a2805e736 Merge branch 'blender-v4.0-release' 2023-10-13 16:17:11 +02:00
Julian Eisel
b8673bfbe2 Fix spreadsheet tree-view icons too close to collapse icon
There was a little hack to remove padding from buttons following the collapse
icon by setting the `UI_BUT_NO_TEXT_PADDING` flag, since that added excessive,
weird looking spacing. This shouldn't be done for buttons with icons, as it
moves the icons too close to the collapse chevron, and is visibly inconsistent
with other icon labels in the tree.

Turns out, that the entire hack to set the `UI_BUT_NO_TEXT_PADDING` flag is
unnecessary since 5c2330203e, which sets the flag everywhere for comparable
situations. So the hack can be removed.
2023-10-13 16:09:56 +02:00
Jacques Lucke
934c68804b Merge branch 'blender-v4.0-release' 2023-10-13 15:46:11 +02:00
Jacques Lucke
75c333ee5c UI: use dash and underscore as word separators in string search
Sometimes, those are used instead of spaces, but there should be
no functional difference to using spaces.
2023-10-13 15:42:10 +02:00
Christoph Lendenfeld
4050b0d6df Refactor: remove argument from ANIM_builtin_keyingset_get_named
No functional changes

`ANIM_builtin_keyingset_get_named` had a `KeyingSet *` argument
that was always passed as `nullptr`
This patch removes it to simplify the code.

Pull Request: https://projects.blender.org/blender/blender/pulls/113677
2023-10-13 15:40:42 +02:00
Christoph Lendenfeld
b753ef73a0 Refactor: convert ListBase of tRKS_DSource to Vector
No functional changes

The keying set code was passing around a list
of `tRKS_DSource` through a lot of functions.
It turns it this was just a ListBase wrapper around `PointerRNA`.

So to make it clearer what is passed around, I replaced the
`ListBase` with a `Vector<PointerRNA>`

To make the use of `ANIM_relative_keyingset_add_source` clearer
I made two functions out of it with different parameters.
Those can take the vector as a reference and
EITHER only an `ID *`
OR an `ID *`, `StructRNA *` and a `void *`

Pull Request: https://projects.blender.org/blender/blender/pulls/113675
2023-10-13 15:06:53 +02:00
Jacques Lucke
cb7668e64e Merge branch 'blender-v4.0-release' 2023-10-13 14:40:21 +02:00
Jacques Lucke
0ea193bdb3 Nodes: add forward compatibility for dynamic node declarations
The goal of this patch is to allow us to use dynamic node declarations
for various nodes in a future version without breaking forward compatibility.
The same kind of change should be added to Blender 3.6.

The code added here is not supposed to end up in `main`, so it has to be
removed when merging the release branch.

Pull Request: https://projects.blender.org/blender/blender/pulls/113497
2023-10-13 14:39:51 +02:00
Pratik Borhade
d836aa7931 GPv3: Expose insert keyframe in menu
Create menu similar to legacy GP to expose insert keyframe operation in
user interface. Pressing `I` key will invoke this menu.
(We can further add "key duplicate" and other relevant operation in this menu)

Pull Request: https://projects.blender.org/blender/blender/pulls/113663
2023-10-13 14:07:21 +02:00
Christoph Lendenfeld
6922cb4683 Refactor: keyingsets.cc
No functional changes

Make the code more readable by doing the following
* rename `BKE_keyingset_free` to `BKE_keyingset_free_paths` since that is what it does
* invert `if` and return early to reduce indentation
* add enum value `MODIFYKEY_SUCCESS` to explicitly state the return value, instead of eModifyKey_Returns(0)
* return `INSERTKEY_NOFLAGS` instead of eInsertKeyFlags(0)
* move variables closer to their usage

Pull Request: https://projects.blender.org/blender/blender/pulls/113666
2023-10-13 12:55:54 +02:00
Jeroen Bakker
a0ef7a7910 Vulkan: Image Editor Drawing
When drawing the image editor the depth of the geometry is set to -1.
This will be clipped in Vulkan, but is valid in OpenGL. This PR patches
the shader to be inside the range that both Vulkan and OpenGL support.

This ensures that images are visible in the image editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/113668
2023-10-13 12:54:23 +02:00
Jeroen Bakker
751133c40e GPU: Skip Validating Transform Feedback Shaders When Not Supported
Shaders that require transform feedback should not be validated on
backends that don't support transform feedback.

In Vulkan transform feedback is implemented as an extension and
supported by half of the platforms. It isn't decided yet if we want to
support transform feedback as it is currently used as a fallback for
hair compute shader. In vulkan compute is available on all platforms.

During validation the shader printed a not implemented message.
This change hides that message.

Pull Request: https://projects.blender.org/blender/blender/pulls/113655
2023-10-13 12:50:55 +02:00
Jeroen Bakker
8ebe7d98d7 Vulkan: Remove Renderdoc Extension
When running Blender inside renderdoc an extension can be used to print
from any shader stage to the console. This is useful during developing,
but not so during running/triaging. For now we remove the extension to
not confuse by incorrect error messages.

Pull Request: https://projects.blender.org/blender/blender/pulls/113654
2023-10-13 11:35:56 +02:00
Bastien Montagne
9859622a66 BKE_reports: make the API thread-safe.
This commit makes using (most of) `BKE_report` API safe in
multi-threaded situation.

This is achieved by adding a `std::mutex` lock to the `ReportList`
struct (in a slightly convoluted way unfortunately, due to this being a
DNA struct). This lock is then used to make most operations on
`Reportlist` data thread-safe.

Note that while working on this, a few other minor issues aroze in
existing usages of Reportlist by the WM code, mainly the fact that
`wm_init_reports` and `wm_free_reports` were both useless:
  - init was called in a context where there is not yet any WM, so it
    was doing nothing.
  - free was called on a WM that would be later freed (as part of Main
    freeing), which would also call cleanup code for its `reports` data.
Both have been removed.

Further more, `wm_add_default` (which is the only place where a WM ID is
created) did not initialize properly it reports data, this has been
fixed.

This change is related to the wmJob thread-safety tasks and PRs (#112537,
!113548).

Pull Request: https://projects.blender.org/blender/blender/pulls/113561
2023-10-13 11:29:59 +02:00
Jeroen Bakker
db2328436e Vulkan: Reduce Console Flooding
When Vulkan is started with validation layers the console is flooded.
Somewhere in the Vulkan validation layers or mesa driver (or the
combination) there is an issue where maxBufferSize is reported by the
driver to be 4GB, but the validation layers are reporting any buffer
size to be larger than 4GB.

For now we skip this message to be logged.

Pull Request: https://projects.blender.org/blender/blender/pulls/113652
2023-10-13 11:24:59 +02:00
Jeroen Bakker
26adfcdb57 Revert "Metal: Re-enable workbench NEXT shadows"
This reverts commit 95f01288b0.
It fails on non-apple platforms.
2023-10-13 11:05:02 +02:00
Jason Fielder
95f01288b0 Metal: Re-enable workbench NEXT shadows
With the shift to GPU-driven rendering pipeline,
the SSBO vertex fetch paradigm used to
implement workbench shadows on Metal
instead of utilising the geometry shader
path no longer worked correctly.

This is because the draw submission
required vertex amplification up-front,
based on the expected output geometry
amount for a given input geometry.

This WIP patch aims to resolve this
issue through addition of API to
enable the features within the
GPU driven pipeline.

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/113498
2023-10-13 11:02:06 +02:00
Jeroen Bakker
28c4abe57c EEVEE: Fix Fallback Shader Shadow Page Tile Store
`eevee_shadow_page_tile_store` shader uses `VIEWPORT_INDEX` and `LAYER`.
Both use an optional extension in OpenGL and Vulkan. When the extension
isn't available a geometry shader is injected to emulate the
extension. The generated geometry shader requires `instance_name` to be
set. This wasn't the case for `eevee_shadow_page_tile_store` shader.

This PR also adds a detection for incompatible shader infos.
- Shaders that use `VIEWPORT_INDEX` or `LAYER` cannot have a geometry stage.
  This check is done in debug and release builds.
- Shaders that use a fallback shader should have instance names set in
  the stage interfaces. This check is only done in debug builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/113649
2023-10-13 10:42:25 +02:00
Jeroen Bakker
159e798cdb Vulkan: Add Viewport Array/Layer Workarounds
This PR adds workarounds for platforms that don't support `shaderOutputLayer`
or `shaderOutputViewportIndex`. Some NVIDIA laptop GPUs and ARM GPUs don't
have those device features.

The workaround uses the same approach as OpenGL. A geometry shader is injected
to emulate the feature.

For testing the workarounds they have also been connected to the
`--debug-gpu-force-workarounds` command line argument.

Fixes #113475 by implementing #113529

Pull Request: https://projects.blender.org/blender/blender/pulls/113605
2023-10-13 10:40:11 +02:00
Jacques Lucke
0d83083f29 Merge branch 'blender-v4.0-release' 2023-10-13 10:01:26 +02:00
Jacques Lucke
a9bf212de0 Fix #113563: prioritize main group length in string search
For node search that means that shorter matching node names
are moved further to the top, even if the entire search result is longer
because it is in a deeper menu.

This also more closely resembles how the search worked in Blender 3.6
where the menu path was not included in the search.
2023-10-13 09:59:21 +02:00
Hans Goudey
3e81f66998 Cleanup: Use C++ arrays for SculptUndoNode
Significantly reduce the amount of manual memory management by
replacing owning pointers with `blender::Array`. This also simplifies
counting the size of the undo steps and iterating over the array values
in some cases.
2023-10-13 09:44:35 +02:00
Campbell Barton
91c5eca81f Fix crash dragging images into the animation player
Resolve issues with the animation player drag & drop.

- IMB_exit ran before attempting to load the dropped image,
  crashing when the image was loaded.
- The old event consumer wasn't removed from the system
  causing events to be processed that accessed freed stack memory.
2023-10-13 17:51:53 +11:00
Campbell Barton
51467b0611 Fix crash dragging images into the animation player
Resolve issues with the animation player drag & drop.

- IMB_exit ran before attempting to load the dropped image,
  crashing when the image was loaded.
- The old event consumer wasn't removed from the system
  causing events to be processed that accessed freed stack memory.
2023-10-13 17:49:36 +11:00
Campbell Barton
ac82a7c3f8 Merge branch 'blender-v4.0-release' 2023-10-13 17:32:55 +11:00
Campbell Barton
9306bb9084 Merge branch 'blender-v4.0-release' 2023-10-13 17:32:51 +11:00
Campbell Barton
8768248924 Merge branch 'blender-v4.0-release' 2023-10-13 17:32:48 +11:00
Campbell Barton
5e6a34ac6c Fix memory leak with Wayland drag & drop
The data-offer for drag & drop wasn't freed when cancelled or not
dropped on a Blender owned surface.
2023-10-13 17:31:02 +11:00
Jeroen Bakker
4cedbb9cb7 Fix #113310: Python gpu.state.scissor_test_set Not Updating State
When using scissor_test_set the framebuffer wasn't marked dirty and
would not always translate the start to actual driver commands.

Pull Request: https://projects.blender.org/blender/blender/pulls/113642
2023-10-13 07:44:11 +02:00
Jeroen Bakker
6a147ef7c9 Cleanup: Make format 2023-10-13 07:38:24 +02:00
Campbell Barton
c814c0295d Merge branch 'blender-v4.0-release' 2023-10-13 15:46:41 +11:00
Campbell Barton
962d0d2bee Merge branch 'blender-v4.0-release' 2023-10-13 15:46:11 +11:00
Campbell Barton
a3190a1d02 Merge branch 'blender-v4.0-release' 2023-10-13 15:45:57 +11:00
Campbell Barton
3e9403bd76 Fix drag & drop crash when dragging over window decorations on Wayland
Missing null checks for drag events for non-GHOST surfaces
(typically window decorations).
2023-10-13 15:34:21 +11:00