Commit Graph

98339 Commits

Author SHA1 Message Date
Brecht Van Lommel
8bf4aa2fdc Merge branch 'blender-v3.5-release' 2023-03-17 11:17:40 +01:00
Brecht Van Lommel
38688adaad Fix #105818: material preview invalid memory access reported by ASAN
Preview render depsgraphs are put in the depsgraph registry
concurrently with other threads. This was lacking a mutex lock
and a map value that remains unchanged when other elements of
the map are updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/105839
2023-03-17 11:17:01 +01:00
Martijn Versteegh
da590428c3 Merge branch 'blender-v3.5-release' 2023-03-17 10:08:42 +01:00
Martijn Versteegh
aca3039740 Fix #104730: Suppress using anonymous UV layers for rendering
When an object has no UV layers and an anonymous UV layer is created,
the anonymous layer gets set as the default (render) layer. This is
very confusing because it then uses a hidden anonmous layer. This patch
suppresses the usage of anonymous layers for rendering.

Pull Request: https://projects.blender.org/blender/blender/pulls/105192
2023-03-17 09:42:54 +01:00
Jeroen Bakker
4892a132bc Python: Unable to use gpu.state.scissor_test_set.
`scissor_test_set` wasn't able to parse the arguments that were
passed correctly, due to incorrect control data during functino
registration.

This patch uses the correct control data during registration and
is able to parse arguments.

Ref: #104911

Pull Request: https://projects.blender.org/blender/blender/pulls/105850
2023-03-17 08:03:55 +01:00
Campbell Barton
e853a67efc Cleanup: use BKE_blendfile_* for functions defined in BKE_blendfile.h 2023-03-17 16:45:42 +11:00
Campbell Barton
3b8a050fc1 Cleanup: use function-style casts, ELEM & STREQ macros 2023-03-17 16:45:42 +11:00
Campbell Barton
976b17e415 Cleanup: remove redundant casts 2023-03-17 16:45:42 +11:00
Campbell Barton
b6b0bc4531 Cleanup: spelling in comments 2023-03-17 16:45:42 +11:00
Campbell Barton
01a29ebaeb Merge branch 'blender-v3.5-release' 2023-03-17 14:52:04 +11:00
Campbell Barton
c169f67dc1 Fix #103263: Touchpad gestures changing pivot point of rotation/zooming
Auto-depth is no longer reset during consecutive touch-pad motion.

Details:

- Add wmEvent::flag, WM_EVENT_IS_CONSECUTIVE to detect consecutive
  track-pad & NDOF motion events. Expose via RNA as Event.is_consecutive.

- Consecutive events are broken by button/key presses and mouse motion.

- Add `WM_event_consecutive_data_*` functions, so operators can store
  data between consecutive events.

- Add `ED_view3d_autodist_last_*` functions to access the last autodist
  pivot point for view operators to use.
2023-03-17 14:48:50 +11:00
Harley Acheson
f78f05c749 Refactor: U.dpi_fac -> U.scale_factor
A renaming of UI scale factors from names that imply a relationship to
monitor DPI to names that imply that they simply change "scale"

Pull Request: https://projects.blender.org/blender/blender/pulls/105750
2023-03-17 04:19:05 +01:00
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