Commit Graph

120055 Commits

Author SHA1 Message Date
Jeroen Bakker
b86ed45fcb Fix unreported: Vulkan: Empty device list
The list of vulkan devices is empty. This regression was introduced by
91960b07db. Vulkan needs to initialize the
platform twice. Once when the backend starts, and the second time when
the device is selected. The device list is added when the backend
starts, but was cleared when the device was initialized, making the list
empty.

Pull Request: https://projects.blender.org/blender/blender/pulls/130020
2024-11-08 12:29:23 +01:00
Jeroen Bakker
b2e1677b36 Fix: Vulkan: Incorrect depth on ARM devices
When gl_FragDepth is defined in the fragment shader and the depth isn't
written to the driver would reset the value to 0. This PR fixes this by
not putting the gl_FragDepth in the shader when it uses the
`depth_unchanged` qualifier or doesn't find any usage in the GLSL.

Pull Request: https://projects.blender.org/blender/blender/pulls/130016
2024-11-08 12:27:46 +01:00
Pratik Borhade
b1bcdf8d53 Fix #130010: Fill mask crash with multires
&subdiv_ccg and node span in fill_mask_grids becomes invalid after
`BKE_sculpt_mask_layers_ensure` call (`sculpt->subdiv_ccg` pointer updated
in `BKE_scene_graph_evaluated_ensure`). To avoid this, move multires
reference and GridNode array after that function.

Pull Request: https://projects.blender.org/blender/blender/pulls/130014
2024-11-08 11:16:00 +01:00
Lukas Tönne
021e010a07 Merge branch 'blender-v4.3-release' 2024-11-08 10:22:58 +01:00
Lukas Tönne
449e7229f3 Fix #129749: Use consistent GPv3 color settings in different modes
Always use the Brush.color setting in the Draw mode side bar.
Technically the "Color" panel in the sidebar can draw in other modes,
but it's polling for explicit tools that limit it to the Draw mode
implicitly.

Use the appropriate brush or unified color in other GP modes based on
the unified paint settings flag.

Worth noting this was technically broken for a long time:
The default was that unified paint is disabled, so the GP panels would
use the brush color as expected. Enabling unified paint would then break
the colors, probably wasn't done very frequently since GP files
and e.g. mesh sculpting don't mix often. The default was changed in
#129127 to enable unified paint by default, which now breaks GP colors
by default.

Pull Request: https://projects.blender.org/blender/blender/pulls/129790
2024-11-08 10:21:24 +01:00
Lukas Tönne
9a03f283e8 Fix #129346: GPv3: Merge layers into correct groups when applying modifier
Applying a modifier on Grease Pencil objects tries to maintain the
original layer order by inserting each layer after the previous. This
ignores layer groups and all layers get move to the root group.
This patch replaces the simple `previous_node` with a per-group pointer
map, which maintains order within each group only.

The code is also creating new layers when the original node of the same
name is a group. This was creating duplicate names which are not allowed
and break various things (layer editing buttons, panel open/close
toggles, etc.). Now these new layer names are made unique to avoid a
name conflict.

One remaining issue is that mixed layer/group ordering is lost: All the
layers get pushed to the bottom of the stack, due to the way
`geometry::merge_layers` ignores layer groups. The existing groups in
the orig data are not sorted along with the evaluated layers, so they
move to the top of the stack. This requires changes to `merge_layers`
and should be handled separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/129943
2024-11-08 08:28:06 +01:00
Pratik Borhade
0fd2c747fc Fix #126076: GPv3: Strokes in multi-frame mode always use onion skinning colors
`grease_pencil_layer_final_tint_and_alpha_get` wrongly sets custom
 onion skinning color to "gpLayerTint"

Pull Request: https://projects.blender.org/blender/blender/pulls/129960
2024-11-08 08:12:31 +01:00
John Kiril Swenson
25f34c0614 Merge branch 'blender-v4.3-release' 2024-11-07 22:48:15 -06:00
YimingWu
54d957a44e Fix #129873: GPv3: Missing material name overlay
The option of showing material name overlay is present but the feature
was missing in GPv3. This fix adds material name overlay back for GPv3.

Pull Request: https://projects.blender.org/blender/blender/pulls/129936
2024-11-08 05:05:32 +01:00
Clément Foucault
4416e27b14 GPU: GLSL C++ stubs: Add support for depth and buffer sampler fetch 2024-11-08 00:28:59 +01:00
Clément Foucault
0a3008172b Cleanup: GPU: Silence shader warnings 2024-11-08 00:28:08 +01:00
Clément Foucault
62a5671587 Cleanup: DRW: Remove unused shader functions 2024-11-08 00:27:42 +01:00
Sean Kim
7262146c1f Merge branch 'blender-v4.3-release' 2024-11-07 13:20:47 -08:00
Sean Kim
5c880a5291 UI: Revert default brush icon to monochrome version
Earlier in the brush assets project, for mesh sculpting, grease pencil,
and curves sculpting, the toolbar brush icon used was changed to a
version with a green highlight. This commit reverts that change to use
the monochrome grey icon instead in each of these modes.

For Sculpt mode specifically, the Paint tool icon is kept as this green
version to differentiate the usages. In future releases, further changes
are planned for sculpting related brushes to better represent their
functionality.

---

### Sculpt Mode Toolbar

![image](/attachments/f1575814-88f0-44f7-8ab6-7b069ff09763)

Pull Request: https://projects.blender.org/blender/blender/pulls/129934
2024-11-07 22:13:58 +01:00
Germano Cavalcante
1633766c2e Refactor: move blenlib system_win32 to C++ 2024-11-07 17:33:27 -03:00
Falk David
5de9dd1786 Merge branch 'blender-v4.3-release' 2024-11-07 18:34:53 +01:00
Falk David
761f075f8d Fix #128280: GPv3: Realize instances doesn't copy grease pencil parameters
In `execute_realize_grease_pencil_tasks` we create a new `GreasePencil`
but don't copy the parameters of (one of) the source grease pencils.

The fix adds `BKE_grease_pencil_copy_parameters` to copy the parameters
of the last src grease pencil.

Note: `BKE_grease_pencil_copy_parameters` copies the materials array. We
might want to remove this and always do the copy of this using a separate
function because some callers need their own way of copying them.

Pull Request: https://projects.blender.org/blender/blender/pulls/129977
2024-11-07 18:33:24 +01:00
Bastien Montagne
b0842c24b6 Merge branch 'blender-v4.3-release' 2024-11-07 18:27:34 +01:00
Bastien Montagne
320c77b963 Fix #123769: Assert when saving a file with deleted workspaces.
Delete sceens when their workspace is deleted.

Also remove `IDTYPE_FLAGS_NEVER_UNUSED` tag from bScreen ID type, there
is no more point to keep these IDs around if they are not used, there
are supposed to be mere sub-data of the Workspaces.

Pull Request: https://projects.blender.org/blender/blender/pulls/129975
2024-11-07 18:22:21 +01:00
Hans Goudey
ba94dbc9c2 Cleanup: Remove unused grease pencil legacy "orig" pointers
Unused for annotations. See #123468.

Pull Request: https://projects.blender.org/blender/blender/pulls/129979
2024-11-07 17:54:15 +01:00
Omar Emara
80b4297b57 Compositor: Implement Convert Color Space for new CPU compositor
Reference #125968.
2024-11-07 18:28:43 +02:00
Jacques Lucke
4ba30cf82e Fix #129417: Geometry Nodes gizmos don't create keyframes when auto keying is on
This uses the existing autokeying API to insert keys after changing properties
using geometry nodes gizmos.

Pull Request: https://projects.blender.org/blender/blender/pulls/129964
2024-11-07 16:14:44 +01:00
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