Commit Graph

98327 Commits

Author SHA1 Message Date
Richard Antalik
e4eb9e04e0 Fix #105823: Crash While deleting retiming handles
Handle index operator property was exposed to user, which was
unintended. The property is validated only in invoke function.
2023-03-17 03:26:37 +01:00
Brecht Van Lommel
aa2d8647c1 Merge branch 'blender-v3.5-release' 2023-03-16 23:19:59 +01:00
Brecht Van Lommel
20a8bc1204 Fix #105455: GPU subdivision with textures corrupts display after undo
This is an issue revealed by the recent optimization in 4d3bfb3f41 to have
CPU and GPU subdivision topology both cached.

BKE_subsurf_modifier_subdiv_descriptor_ensure is what (re)creates the
topology refiner when needed. Invalidating the topology refiner on changes
must be done before it, otherwise we end up with an incomplete Subdiv that
either does not draw or draws incorrectly.

Pull Request: https://projects.blender.org/blender/blender/pulls/105844
2023-03-16 23:18:55 +01:00
Harley Acheson
9a8bfe8dd3 Cleanup: Make format
Simply adds a single blank line.
2023-03-16 14:23:40 -07:00
Leon Schittek
339e9deb72 Merge branch 'blender-v3.5-release' 2023-03-16 21:45:16 +01:00
Leon Schittek
f46fb8051d Fix #105778: Prevent invalid links with link swap
Remove swapped links when they link sockets that belong to
the same node.

Pull Request: https://projects.blender.org/blender/blender/pulls/105809
2023-03-16 21:39:32 +01:00
Brecht Van Lommel
f234d2d440 Subdivision: remove info message that GPU subdivision being used
This is the normal case, it's only when both CPU and GPU subdivision is used
that the user needs to be informed that performance is suboptimal.
2023-03-16 19:48:55 +01:00
Jacques Lucke
34f3893831 BLI: support recursive usage of Vector
This makes it possible to use `Vector` recursively if the inline buffer
has 0 size. Any other inline buffer size does not work, because then
the type would be embedded in itself which does not make sense.

Pull Request: https://projects.blender.org/blender/blender/pulls/105832
2023-03-16 17:52:03 +01:00
Julian Eisel
ee213f3c4d Merge branch 'blender-v3.5-release' 2023-03-16 15:58:34 +01:00
Julian Eisel
a958ae36e8 Fix #104305: Crash in node editor with large asset libraries
Various UI code would store the `AssetHandle` in a way that turns out to
be unsafe. The file-data is part of the file browser caching system that
releases file-data when a certain maximum of items is in the cache. So
even while just iterating over the assets, earlier iterated asset
handles may become invalid. Now asset handles are really treated as
volatile, short lived objects.

For the asset-view, the fix was more involved. There we need an RNA
collection of asset-handles, because the UI list code requires that. So
we create a dummy collection and get the asset handles as needed by
index. This again meant that I had to keep the index of the collection
and the asset-list in sync, so all filtering had to be moved to the UI
list.
I tried duplicating the file-data out of the cache instead, but that
caused problems with managing the memory/ownership of the preview
images.

`AssetHandle` should be removed and replaced by `AssetRepresentation`,
but this would be an even more disruptive change (breaking API
compatibility too).

Fixes #104305, #105535.

Pull Request: #105773
2023-03-16 15:40:31 +01:00
Julian Eisel
cb20f2cbf9 Fix build error after previous merge
Function was moved and renamed in 48814c25fd.
2023-03-16 15:27:27 +01:00
Julian Eisel
7317da80fe Merge branch 'blender-v3.5-release' (won't build, see followup) 2023-03-16 15:26:23 +01:00
Julian Eisel
55811b2919 Assets: Add function to query data-block library path from asset
No user visible change.

This is needed for #105773, but will cause conflicts in the main branch,
so committing it separately.
2023-03-16 15:25:00 +01:00
Julian Eisel
d1b8a827a6 Refactor: Avoid unsafe strcpy in library path utility function
Make sure the expected max-length for the string is respected.

Suggested by Bastien in #105825.
2023-03-16 15:07:27 +01:00
Julian Eisel
b80f6c4017 Cleanup: Improve comment on library path utility function
Suggested by Bastien in #105825.
2023-03-16 15:07:27 +01:00
Julian Eisel
48814c25fd Cleanup: Move blend file path utilities out of blenloader module
These are not really about reading or writing .blend files, they are
general utilities for file-names/paths. Having to link to the
blendloader library just for these utilities is annoying.
Moved them to `BKE_blendfile.h` now, in agreement with Bastien.

Pull Request: #105825
2023-03-16 15:07:27 +01:00
Miguel Pozo
8bb411ad1a EEVEE Next: IrradianceCache surfels debug display
Add a surfels debug pass to aid with the GI implementation development.

Pull Request: https://projects.blender.org/blender/blender/pulls/105802
2023-03-16 14:14:33 +01:00
Julian Eisel
bb0ee9fdb4 Fix tiny file browser highlight offset on retina screens
While this was just a single pixel off, it was a bit notable since the
highlight wasn't centered correctly. Now retina and non-retina screens match
visually.
2023-03-16 12:48:56 +01:00
Jeroen Bakker
5e0cc9d277 Cleanup: Silence Unused parameter warnings.
- blender::gpu::GLContext
- blender::gpu::VKContext
2023-03-16 09:44:09 +01:00
Jeroen Bakker
a25cc51db9 Cleanup: Spelling in previous commit. 2023-03-16 08:55:45 +01:00
Jason Fielder
3d9d67594c GPU: Add GPU frame capture support.
Adds two modes of GPU frame capture support for
enhanced debugging. GPU frame capture begin/end
allow instantaneous frame capture of all GPU commands
within the capture boundary.

GPU frame capture scopes allow several user-defined capture
regions which can wrap key parts of code. These scopes are
exposed to connected GPU tools allowing the user to manually
trigger a capture of a known scope at the desired time.

This is currently integrated with the Metal backend for
support with Xcode.

Related to #105591

Pull Request: https://projects.blender.org/blender/blender/pulls/105717
2023-03-16 08:54:05 +01:00
Jeroen Bakker
397f6250a5 Merge branch 'blender-v3.5-release' 2023-03-16 08:28:21 +01:00
Jason Fielder
7bdd82eca0 Metal: Resolve Race Condition in Memory Manager
Fix race condition if several competing threads are inserting Metal
buffers into the MTLSafeFreeList simultaneously while a new list
chunk is being created.

Also raise the limit for an MTLSafeFreeListChunk size to optimize
for interactivity when releasing lots of memory simultaneously.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/105254
2023-03-16 08:25:15 +01:00
Jason Fielder
d3409f2159 Fix: Uncached Metal Materials not Being Released
Optimized node graphs do not get cached and were
not correctly freed once their reference count reached
zero, due to being excluded from the GPUPass garbage
collection.

Also suppress Metal shader warnings, which are prevalent
during material optimization.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/105795
2023-03-16 08:19:32 +01:00
Jason Fielder
94855119da Fix: Metal validation error when shader has no uniforms
Metal buffer binding validation would trigger an error
when a given shader had an empty PushConstantBlock.
This patch removes the default uniform code gen if
no uniforms are present, to avoid any possible issues
with buffers being bound to a shader where the destination
data block is size zero.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/105796
2023-03-16 08:10:38 +01:00
Jason Fielder
ac6a70e5f8 Fix #104012: Selection crash with AMD on Metal
Crash when selecting objects on AMD platforms running
Metal. This was caused by shader compilation warnings
being treated as errors in macOS 10.15. Wrapping
compilation failure with success check resolves error.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/105739
2023-03-16 08:03:15 +01:00
Jason Fielder
b96f8ac9fe Fix #105606: Metal texture upload regression
immDrawPixels performs significantly slower in Metal
than OpenGL. This was caused by two main factors. Firstly,
the additional overhead of tiled texture update, where all
memory needed to be kept in flight for each update, but
caused update to take a slow path. Avoiding tile update
with Metal is more efficient for both memory pressure
and GPU pipelining.

Secondly, on AMD platforms, the staging buffer used
for temporary texture data was page-faulting when
several texture updates would occur within one frame.
This is due to limitations of allocating one large contiguous
memory chunk. Using the Metal buffer pool for staging
data is more efficient.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/105794
2023-03-16 07:59:22 +01:00
Campbell Barton
ebad816057 Merge branch 'blender-v3.5-release' 2023-03-16 17:20:28 +11:00
Campbell Barton
d3e37d3ed2 Fix #105224: Node editor NDOF pan changes RGB colors
Disable NDOF changing colors for 2D views since it conflicts with
panning.
2023-03-16 17:17:33 +11:00
Richard Antalik
b6caf5980e Merge branch 'blender-v3.5-release' 2023-03-16 04:47:15 +01:00
Richard Antalik
1ad3fa09c9 Fix #90389: No labels in scrubbing area with small FPS
Maximum distance of lines in screen space is limited. This limit seems
reasonable for FPS higher than 1, but UI allows to set 0.01 FPS with
soft. even lower values are possible.

This patch allows for normal operation within soft limits and labels are
still visible and quite usable within hard limits.

Pull Request: https://projects.blender.org/blender/blender/pulls/104849
2023-03-16 04:42:27 +01:00
Hans Goudey
bad85fe8c7 Cleanup: Avoid keeping mesh normals references after dirty tag
Without assumptions of a mesh's direct ownership of its normals,
this was error prone, since normals could potentially be reallocated
when they are tagged dirty or retrieved with write access.
2023-03-15 21:39:50 -04:00
Campbell Barton
896360de1f Cleanup: remove GCC warning pragma
I'm no longer able to generate a warning with GCC 12.2.1.
2023-03-16 11:46:56 +11:00
Campbell Barton
42380ea996 Cleanup: use static declaration, quiet undeclared warning 2023-03-16 11:24:14 +11:00
Campbell Barton
64304b4e27 Fix invalid enum passed to BKE_id_attribute_search 2023-03-16 11:24:11 +11:00
Hans Goudey
f2a05c3e4e Cleanup: Remove unused pbvh function declarations 2023-03-15 20:13:34 -04:00
Jesse Yurkovich
0fe006eec5 Merge branch 'blender-v3.5-release' 2023-03-15 16:12:47 -07:00
Damien Picard
d7a68a9de8 Fix: Correct several messages in the UI
- Show/hide mask layers: the tooltip was confusing from a user's
  perspective, because they should not be expected to know what a hide
  flag is.
- Active Spline -> Active Point: likely a copy and paste error.
- Geo Nodes face is planar node: forgotten article.
- Axes, plural instead of axis for the viewport preferences. Here
  there are several usages of axis or axes. Since they refer to
  coordinate axes I believe they should be plural, even though the
  property `mini_axis_type` is still wrong.

-----
![image](/attachments/7ccdc72d-1e83-4c22-b8e9-c3b7c5fcf629)
![image](/attachments/746015bc-23e1-49bc-8828-df07d7605048)
![image](/attachments/61c58766-a8f5-4a90-b862-c9b57c44c355)

Pull Request: https://projects.blender.org/blender/blender/pulls/105814
2023-03-16 00:12:29 +01:00
Jesse Yurkovich
09cff506c1 Fix #89630: Hide backfaces when using using the "Alpha Blend" blend method
For proper display, backfaces should be hidden when using the "Alpha Blend" blend method:
https://docs.blender.org/manual/en/dev/render/eevee/materials/settings.html#blend-mode

See the mentioned bug for various examples.

Pull Request: https://projects.blender.org/blender/blender/pulls/105585
2023-03-16 00:10:26 +01:00
Chris Blackbourn
c38fe87127 UV: Improve UV Packing efficiency with non-square aspect ratio
Improve pre-conditioning of UV Islands before passing them to the UV Packing API.

Pull Request: https://projects.blender.org/blender/blender/pulls/105784
2023-03-15 21:29:31 +01:00
Germano Cavalcante
f6c70755d1 Measure Tool: reduce snap overhead
No functional changes.

This is just a micro-optimization to avoid updating `prev_point` and
calling `ED_gizmotypes_snap_3d_data_get` when snapping is not enabled.
2023-03-15 17:14:57 -03:00
Germano Cavalcante
b79ad1f93f Merge branch 'blender-v3.5-release' into main 2023-03-15 17:14:42 -03:00
Germano Cavalcante
4cd102bb73 Fix #105664: measure tool ignoring snap on first click
The bug only happened in wireframe mode.

Originally the `const bool use_depth` indicated when projection should
be done on invoke.

Later it started to indicate when to snap on invoke.

But with keymap snap detection, using this `use_depth` is no longer
correct.
2023-03-15 17:14:23 -03:00
Hans Goudey
b21537d215 Cleanup: Wrap C++ normal accessors with C functions
Implement the two cached normal accessors with C++ methods
directly. This avoids dealing with raw pointers and reduces the
amount of casting necessary.
2023-03-15 15:57:27 -04:00
Hans Goudey
4aa2a3522e Cleanup: Store cached mesh normals with Vector
Avoids manually allocating and freeing the data in some cases,
clarifies ownership, and gives extra safety with the sizes.
2023-03-15 15:57:27 -04:00
Hans Goudey
17a53d6647 Cleanup: Tweak mesh normal accessors documentation
Just reference the C++ functions in the C API, and make the wording
a bit more concise.
2023-03-15 15:57:27 -04:00
Hans Goudey
f9132e2bbf Cleanup: Remove redundant mesh normals dirty tag function
Since normals are derived data, it's always a change to something
else that will cause them to change, like the winding order of a face
or vertex positions. So it's clearer to use tags for those things
directly. It's correct to remove the tag in one place since dirty is
the default state of a new mesh.
2023-03-15 15:57:27 -04:00
Hans Goudey
2daf6c69be Merge branch 'blender-v3.5-release' 2023-03-15 14:05:29 -04:00
Hans Goudey
d7ac2a177a Cleanup: Use spans and C++ type to access mesh normals
Also rename some variables to use names consistent with elsewhere.
2023-03-15 14:03:05 -04:00
Hans Goudey
d9c2fb9ae2 Cleanup: Remove mesh validation of cached normals
This validation dates back to when vertex normals were stored in
the `MVert` type (before cfa53e0fbe). Since normals
are all calculated in the same place, and aren't saved in files, this
isn't relevant anymore-- they can just be recalculated.
2023-03-15 14:03:05 -04:00