Commit Graph

114733 Commits

Author SHA1 Message Date
Bastien Montagne
e156a422cd Merge branch 'blender-v4.3-release' 2024-11-07 16:01:04 +01:00
Jason Fielder
658700ddff Fix #126364: Metal: modified texture usage flags causing cache misses
For Metal we can change the texture usage flags to get more optimal
behaviour - one example is adding the attachment flag so we can utilise
renders to do texture clears. However these usage flags are used as the
part of the match-criteria when trying to reuse released textures in
the texture pool.

The modifications means a request for the same type of texture will
fail causing a cache miss. When we render to an
image-view the texture pool is not released until the final sample has
been rendered as we consider the entire render to be a single frame
(as opposed to normal viewport rendering when we are presenting the
intermediate results).

This causes the texture pool to grow and grow and grow hence the large
memory usage. This fix splits the usage flags
into two sets, the internal ones we use to create the MTLTexture (which
we may modify) and the originally requested ones. The originally requested
ones are used for the texture pool matching.

This fix also improves memory efficiency for normal viewport rendering.

Mr Elephant Scene
Before -> After
Load scene in viewport: 13.04Gb ->  9.15 Gb
Viewport Render Image: 78.69Gb -> 16.61Gb

Authored by Apple: James McCarthy

Pull Request: https://projects.blender.org/blender/blender/pulls/129951
2024-11-07 15:53:09 +01:00
Julian Eisel
aa24f0ee36 Merge branch 'blender-v4.3-release' 2024-11-07 15:52:55 +01:00
Julian Eisel
d9748470fa Fix #125230: Issues when loading file with pinning gpencil brush material
Brushes and changes done to them are preserved now when loading
different files (until Blender closes). Unpin and clear the material
assigned to the brush when loading a different file, since this material
is local to the previous file.

Pull Request: https://projects.blender.org/blender/blender/pulls/128080
2024-11-07 15:52:16 +01:00
Julian Eisel
a482ffdf56 Merge branch 'blender-v4.3-release' 2024-11-07 15:50:10 +01:00
Bastien Montagne
c182dadf9f Fix (unreported) GPv3 Undo: memory-after-use.
GPv3 Undo loading code would not clear the active node pointer, leaving
it to point to an invalid (freed) memory, in case there is no active
node in the loaded undo step.

Pull Request: https://projects.blender.org/blender/blender/pulls/129918
2024-11-07 15:40:58 +01:00
Bastien Montagne
0455dbcb4b Fix #129900: GPv3: Invalid handling of unused drawings removal.
Code detecting unused drawings and swapping them with a used one would
fail in a most basic case, leading to invalid state down the line:

```
[used_drawing, unused_drawing]
```

`unused_drawing` was not properly removed, as it is expected.

NOTE: Added an extra assert on (presumably) expected conditions of the
drawing indices and drawings array at the end of the process.

Co-authored-by: Lukas Tönne <lukas@blender.org>
2024-11-07 15:40:57 +01:00
Julian Eisel
3a7b6c4f79 Fix #129622: Crash loading asset library with malformed asset index JSON
Catch any exception from the JSON parser and handle it by returning a
null value from the deserialization function. Let the asset indexer
regenerate the index file to handle the error.

At least for the asset index case we don't care about the exact parsing
error, so this simple error handling strategy is fine. Should more
precise error reporting be necessary for other use-cases this can be
added still, but I think these errors are usually a bit too low level to
expose to users.

Pull Request: https://projects.blender.org/blender/blender/pulls/129879
2024-11-07 15:39:58 +01:00
Jeroen Bakker
48e3402aaf Merge branch 'blender-v4.3-release' 2024-11-07 14:43:39 +01:00
Jeroen Bakker
8887a5ed71 Fix: EEVEE: Better description light probe reduced size message
When the light volume probe cannot be allocated a pool of a different
size is used. A message is displayed to the user. This PR improves the
message by adding the previous size as well.

Ref #129889

Pull Request: https://projects.blender.org/blender/blender/pulls/129963
2024-11-07 14:42:55 +01:00
Omar Emara
ece5f08852 Compositor: Implement Tone Map for new CPU compositor
Reference #125968.
2024-11-07 15:28:44 +02:00
Jacques Lucke
8464d95c4c Merge branch 'blender-v4.3-release' 2024-11-07 14:26:33 +01:00
Jacques Lucke
5cdaa7b0f0 Fix #129642: material lost after first frame in uncached simulation zone
The issue was that some checks didn't handle the no-cache case correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/129959
2024-11-07 14:25:57 +01:00
Jeroen Bakker
a4529f0e17 Merge branch 'blender-v4.3-release' 2024-11-07 14:01:32 +01:00
Jacques Lucke
3688a2919b Merge branch 'blender-v4.3-release' 2024-11-07 14:00:52 +01:00
Jeroen Bakker
da767bcbdc Fix: Vulkan: Enable interleaved tests
Interleaved tests where disabled for Vulkan, but interleaving has been
implemented. This PR enabled these tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/129957
2024-11-07 14:00:51 +01:00
Jacques Lucke
fee02cc224 Fix #129871: converting linked text to mesh results in empty mesh
Similar to other bugs caused by ada367a0e9 (e.g.
ff9de2f7da9dcec96692355a67a7e7e280c223a7), the issue is that the object is
tagged for changes before retrieving its evaluated state.

I can't say I fully understand the all the code path for the object conversion
already. However, the change seems to make sense based on the `/* other users
*/` comment right above the change.  Also, the selected object is tagged again
further down in my test anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/129948
2024-11-07 14:00:21 +01:00
Jeroen Bakker
e0f699abdb Fix: Vulkan: Read & write outside of bounds
When running test cases
`test_texture_roundtrip__GPU_DATA_10_11_11_REV__GPU_R11F_G11F_B10F`
would read and write outside of allocated memory. This is an error in
the test case itself the GPU API doesn't have a public function to get
the desired byte and component size.

Pull Request: https://projects.blender.org/blender/blender/pulls/129958
2024-11-07 13:59:53 +01:00
Jeroen Bakker
91960b07db Fix unreported: Vulkan: Memory leak
When exiting Blender the list of devices was not freed, leading
to a memory leak.

Pull Request: https://projects.blender.org/blender/blender/pulls/129956
2024-11-07 13:59:07 +01:00
Jacques Lucke
a7d689f831 Fix #129871: converting linked text to mesh results in empty mesh
Similar to other bugs caused by ada367a0e9 (e.g.
ff9de2f7da9dcec96692355a67a7e7e280c223a7), the issue is that the object is
tagged for changes before retrieving its evaluated state.

I can't say I fully understand the all the code path for the object conversion
already. However, the change seems to make sense based on the `/* other users
*/` comment right above the change.  Also, the selected object is tagged again
further down in my test anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/129948
2024-11-07 13:59:02 +01:00
Lukas Tönne
41b3f05a63 Merge branch 'blender-v4.3-release' 2024-11-07 13:33:33 +01:00
Lukas Tönne
dc04d9abc7 Fix (unreported): GPv3: Incorrect user count for drawing at index 0
The `GreasePencil::update_drawing_users_for_layer` function was using an
incorrect drawing index check, skipping over drawing 0 every time.
As a consequence the first drawing may have zero users despite at least
one frame referencing it.

Pull Request: https://projects.blender.org/blender/blender/pulls/129955
2024-11-07 13:31:34 +01:00
Jacques Lucke
abbe77b90f Merge branch 'blender-v4.3-release' 2024-11-07 13:29:24 +01:00
Jacques Lucke
59bc3f0959 Fix #129522: renaming sockets in node does not work for some types 2024-11-07 13:27:12 +01:00
Julian Eisel
0e0939b83f Fix #129112: Asset shelf ignores double-click keymap item
Double clicks would be captured by view-item renaming, even when renaming
wasn't supported.

Pull Request: https://projects.blender.org/blender/blender/pulls/129919
2024-11-07 12:57:28 +01:00
Christoph Lendenfeld
c2371028e0 Refactor: armature_add.cc
No functional changes expected.

Change function names to be snake case as defined in the style guide[1].
Change functions to static if they aren't called outside the file.
Use `continue` to un-indent code.
Make function arguments `const` where possible.

[1] https://developer.blender.org/docs/handbook/guidelines/c_cpp/#naming

Pull Request: https://projects.blender.org/blender/blender/pulls/129946
2024-11-07 12:40:46 +01:00
Sybren A. Stüvel
c06c96b2b8 RNA: quote callback function name in error message
When reporting "could not create instance of {class} to call callback
function {function}", put single quotes around the name of the function.
This will make it easier to understand that that word is actually a
function name, and not some verb in the sentence.

Before:

> RuntimeError: could not create instance of
> AMP_TIMELINE_TOOLS_OT_anim_lattice to call callback function execute

After:

> RuntimeError: could not create instance of
> AMP_TIMELINE_TOOLS_OT_anim_lattice to call callback function 'execute'

Pull Request: https://projects.blender.org/blender/blender/pulls/129780
2024-11-07 12:13:50 +01:00
Omar Emara
91511b3386 Compositor: Implement Split node for new CPU compositor
Reference #125968.
2024-11-07 13:12:55 +02:00
Omar Emara
14583742dc Compositor: Implement Normalize for new CPU compositor
Reference #125968.
2024-11-07 13:12:55 +02:00
Omar Emara
c8ded4bf88 Compositor: Implement Levels node for new CPU compositor
Reference #125968.
2024-11-07 13:12:55 +02:00
Omar Emara
ad7f03c623 Compositor: Implement parallel reduction for new CPU compositor
Reference #125968.
2024-11-07 13:12:54 +02:00
Falk David
5ba1a376e5 Merge branch 'blender-v4.3-release' 2024-11-07 12:02:47 +01:00
Clément Foucault
a43a209959 Fix #129567: GPv3: Incorrect wireframe for strokes
First this make the wire batch use the same set of drawing that the main
gpencil batch uses (as they share the same VBO data, they need to use
the same drawings).

Then we skip drawing the onion frames by nullifying the indices in the
index buffer. A better way would be to skip these strokes or drawing
but that can be done later and seems more bug prone.

Pull Request: https://projects.blender.org/blender/blender/pulls/129920
2024-11-07 12:01:36 +01:00
casey bianco-davis
a114534295 Fix #121233: GPv3: Primitives: Add missing confirm action and ability to pan viewport.
This adds `MMB+shift`/`MMB+Alt` for panning, while keeping `MMB` to confirm.

Pull Request: https://projects.blender.org/blender/blender/pulls/122813
2024-11-07 12:00:29 +01:00
Falk David
8abd686863 Merge branch 'blender-v4.3-release' 2024-11-07 11:58:44 +01:00
casey bianco-davis
817f7c0747 Fix #121233: GPv3: Primitives: Add missing confirm action and ability to pan viewport.
This adds `MMB+shift`/`MMB+Alt` for panning, while keeping `MMB` to confirm.

Pull Request: https://projects.blender.org/blender/blender/pulls/122813
2024-11-07 11:57:56 +01:00
Falk David
ffd80047ee Fix #124725: GPv3: Masked layers not rendered correctly with onion skinning
The issue was that the masks for the current frame would be
rendered for a different frame.
Unfortunately, we can't easily render masks for the onion
skinned frames correctly at the moment.

The fix makes it so that we render the mask only for the current frame.

Pull Request: https://projects.blender.org/blender/blender/pulls/129878
2024-11-07 11:54:33 +01:00
Sean Kim
831166b4dc Fix #129907: Grease Pencil brush size gets stuck at 0
Possibly due to c13cde24cc

This commit clamps the `brush->size` value to 1 at lowest for the
Grease Pencil Draw mode. There are situations where when the brush scene
space value is set to a small enough size that the distance calculated
by `project_brush_radius` becomes 0.

When this value is set as the actual brush size, the `wm.radial_control`
operator fails to work properly as the new size is now lower than the
expected minimum value, causing incorrect clamping of the modal value.

Pull Request: https://projects.blender.org/blender/blender/pulls/129937
2024-11-07 10:50:46 +01:00
Sergey Sharybin
30ba6bfa7e Cleanup: Unused function argument 2024-11-07 10:37:44 +01:00
Hans Goudey
ba03407e33 Cleanup: Subdiv: Remove unnecessary C-API header
Use the topology refiner header directly.
Followup for 5e46e3d28a.

Pull Request: https://projects.blender.org/blender/blender/pulls/129941
2024-11-07 10:36:53 +01:00
Jeroen Bakker
acb49ee889 Merge branch 'blender-v4.3-release' 2024-11-07 10:30:53 +01:00
Sean Kim
d6db951d92 Fix #129907: Grease Pencil brush size gets stuck at 0
Possibly due to c13cde24cc

This commit clamps the `brush->size` value to 1 at lowest for the
Grease Pencil Draw mode. There are situations where when the brush scene
space value is set to a small enough size that the distance calculated
by `project_brush_radius` becomes 0.

When this value is set as the actual brush size, the `wm.radial_control`
operator fails to work properly as the new size is now lower than the
expected minimum value, causing incorrect clamping of the modal value.

Pull Request: https://projects.blender.org/blender/blender/pulls/129937
2024-11-07 10:29:44 +01:00
Jeroen Bakker
f3342fa680 Fix #129708: Vulkan: Add limit checks when creating images
Drivers should perform a limit check when creating images and return
`VK_ERROR_OUT_OF_DEVICE_MEMORY`. However there are drivers where this
check is a pass-through and leads to `VK_ERROR_DEVICE_LOST`.

This issue was introduced !128877 and only shows up on official NVIDIA
drivers.

Pull Request: https://projects.blender.org/blender/blender/pulls/129939
2024-11-07 10:29:40 +01:00
Jeroen Bakker
8e85a16997 Revert "Vulkan: Disable GPU depth picking on official AMD/NVIDIA drivers"
This reverts commit f896242477. For
Blender 4.3 we added a workaround, but the root cause should still be
identified and fixed.
2024-11-07 10:08:42 +01:00
Jeroen Bakker
8c9b5a46c1 Merge branch 'blender-v4.3-release' 2024-11-07 10:08:23 +01:00
Jeroen Bakker
f896242477 Vulkan: Disable GPU depth picking on official AMD/NVIDIA drivers
There is an issue in the GPU depth picking that is only visible
in official AMD/NVIDIA drivers. AMD does pick objects that are
around the cursor. NVIDIA drivers include any overlay objects.

This PR will disable GPU pick selection for AMD/NVIDIA official
drivers. This will limit some selection functionality.
This PR will be reverted in Blender 4.4 to find the root cause.

Ref: #128624, #127768
Pull Request: https://projects.blender.org/blender/blender/pulls/129863
2024-11-07 10:07:08 +01:00
Jeroen Bakker
b5414f716f Merge branch 'blender-v4.3-release' 2024-11-07 09:17:08 +01:00
Hans Goudey
ae1a1335b9 Curves: Avoid squaring distances unnecessarily in selection functions 2024-11-07 09:11:44 +01:00
Jeroen Bakker
bc480f05d5 Draw: Reduce overhead of sharing meshes without attributes
When using a lot of instances the requested and needed attributes
are merged. This process uses a lock even when no work needs to be
done.

By early exiting the merging process when no work needs to be done
the performance of navigating 60k cubes went from 17.5 fps to 18.3 fps.

Detected when researching #126391.

Pull Request: https://projects.blender.org/blender/blender/pulls/129791
2024-11-07 08:31:08 +01:00
Campbell Barton
168cbca937 Cleanup: remove unused argument 2024-11-07 18:24:48 +11:00