While the drawing code already skipped drawing any key points that are not in view,
it did that with an `if` check within the `for` loop. This can be speed up quite a bit
by calculating the bounding indices beforehand and only iterating that range.
| - | Before | After |
| - | - | - |
| `draw_fcurve_selected_keyframe_vertices` | 44850ns | 3194ns |
| `graph_main_region_draw` | 32ms | 21ms |
Test file used
https://download.blender.org/ftp/sybren/animation-rigging/heavy_mocap_test.blend
Pull Request: https://projects.blender.org/blender/blender/pulls/120521
- Expected results should come before actual result.
- Add test case for 8192 bytes as apple has a push constants size of 4096.
- Add more variation to the first order test data.
Improvements detected when working on vulkan backend and validated they
work on metal and opengl as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/120557
On heavy scenes, the function `get_graph_keyframe_extents`
takes up a considerable amount of the time (~50%) it takes to draw the Graph Editor.
This function is called to set the `View2D` extents which makes the scrollbars work properly.
I'd argue that level of precision isn't needed just to display scrollbars.
Passing the flag as `false` speeds up the drawing code by 22%.
Timings for `graph_main_region_draw`
| Before | After |
| - | - |
| 32ms | 25ms |
Timings for `get_graph_keyframe_extents`
| Before | After |
| - | - |
| ~16ms | ~8ms |
Test file used
https://download.blender.org/ftp/sybren/animation-rigging/heavy_mocap_test.blend
Pull Request: https://projects.blender.org/blender/blender/pulls/120519
Inherited from previous versions of this feature, by default the Purge
operation from the Outliner would remove all unused IDs, recursively.
The same operation invoked from the File -> Clean Up main menu would by
default only delete directly unused IDs.
Now both will by default remove all (directly or indirectly) unused data.
Object names can contain "/" & "\" and aren't safe to use in paths,
use BLI_path_make_safe_filename to ensure the name can be used in a
path.
Ref !120515
Regression caused by [0], also correct memcpy calls that overwrite
listbase link variables and the theme name, note that this is more a
code-correctness issue as it wouldn't cause user visible bugs.
[0]: adbec9eea9
This is needed so we can reliably know which extension is associated
with a theme, so a theme can be refreshed on update and cleared when
uninstalled, needed to resolve!120289.
Currently the node tools asset tree for extending 3D view headers is
rebuilt whenever it's cleared, which is done by clearing the tree's storage.
That means the data is rebuilt on every redraw if there are no node tools
and the tree storage is empty. With larger asset libraries that can be
quite expensive.
Now, instead of clearing the map, use a new dirty tag to store whether
the asset tree is out of date compared to the assets.
This should resolve#120494
This PR moves the three sculpt trim gesture variables from
`SculptSession` into the `TrimOperation` `struct` to reduce
the size of the former and make it less likely that the data
is depended on in other operators.
Pull Request: https://projects.blender.org/blender/blender/pulls/120504
This cleans up our `TEST_SSE_SUPPORT` macro to only test
for SSE42 and passes the flags to the CMAKE_C/CXX_FLAGS
the cpu check module needed to move to its own folder since
the flags at the end of a CMakeLists.txt appear to be used
for all targets inside a CMakeLists file and cpu_check cannot
be build with sse42 flags.
This only affects Mac/Linux since MSVC has no buildflags
to target SSE42
Pull Request: https://projects.blender.org/blender/blender/pulls/118468
In GPv2 strokes could technically have zero points.
`CurvesGeometry` doesn't allow this, so we need to make
sure to explicitly skip over strokes with no points.
Pull Request: https://projects.blender.org/blender/blender/pulls/120536
Not all matrices are invertable (e.g. when a transformation matrix is has
a scale of zero), and it's sometimes important when a matrix is.
This also better specifies the behavior when the matrix is not invertable:
the identity matrix is returned.
Pull Request: https://projects.blender.org/blender/blender/pulls/120530
A small logic issue caused all write-only image resources
to be tagged as read-write in all cases. This caused
correctness issues on Intel and AMD GPUs which
are resolved through this change.
Change also yields a small performance uplift
due to enabling improved non-dependent workload
scheduling.
Authored by Apple: Michael Parkin-White
Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/120528
This PR performs the following refactors in sculpt_trim.cc:
* Remove `depth_front` and `depth_back` as `struct` properties, as they
are only used for generating the Mesh
* Moves the `calculate_depth` call into the `generate_geometry` step as
the latter is dependent on data from the former already
* Reorganize the methods so the overall file reads better.
* Minor comment nits and additions
Pull Request: https://projects.blender.org/blender/blender/pulls/120331
Split code to separate functions depending on the source of info for
socket inspection. Each function retrieves some optional string.
Collecting of result string is just loop.
Pull Request: https://projects.blender.org/blender/blender/pulls/120496
The reverse uv sampling operation generally fails when there the sample position
is within more than one uv triangle. Unfortunately, the combination of limited
floating point accuracy and very small triangle areas caused this case
sometimes, even if the triangles don't actually overlap. This happens relatively
rarely, but if it does, it causes annoying artifacts. The solution is to only
detect these kinds of overlapping triangles if they have a certain minimum size
and to be more relaxed otherwise.
Pull Request: https://projects.blender.org/blender/blender/pulls/120408
Make it match behavior of the previous Python importer: it was
accepting such faces, and then always calling mesh validation function
that got rid of them. Instead of doing the whole validation cost,
just do not add such faces in the first place.
Historically makesdna/rna did not link bf_guardedalloc for
some reason, but during one of my cmake cleanups have picked up
this dependency anyhow. To prevent duplicate symbols, remove the
now duplicated translation units as linking bf_guardedalloc has
seemingly not caused any issues.
Pull Request: https://projects.blender.org/blender/blender/pulls/120490
Bone collections are drawn in the new tree view by accessing properties
from `armature.collections_all[...]`, which means that drivers and
fcurves also target those. This is now taken into account when updating
the bone collection name.
For context: in Blender 4.0 the UIList used `.collections[...]` instead,
for which renaming was already handled properly.
Pull Request: https://projects.blender.org/blender/blender/pulls/120517
Use versioning code to change Drivers & F-Curves targeting
`armature.collections[...` to target `armature.collections_all[...`
instead. The former contains the root collections only, whereas the
latter contains all of them in a flat list. Not only does this fix the
tree view (it binds to properties via the `.collections_all` RNA path),
but also this makes the drivers & animation of the properties work even
when the hierarchy changes.
Note that both `.collections` and `.collections_all` give access to all
bone collections. The former just requires iterating hierarchically,
that is, via `some_collection.children`.
Pull Request: https://projects.blender.org/blender/blender/pulls/120514
Adds support for subpass transition for AMD/Intel IMR
GPUs. This enables correct functioning of EEVEE Next
deferred lighting pass on AMD platforms.
The emulation is consistent with the OpenGL approach
of generating additional texture bindings in the shader
for subpass inputs, and splitting render passes across
sub-pass boundaries.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/119784
`interpolate_curve_attributes()` did not transfer `cyclic` attribute to
target curves. This fixes the the problem and allows Interpolate
Curves node to interpolate cyclic curves and also work between a cyclic
curve and a non-cyclic curve.
Pull Request: https://projects.blender.org/blender/blender/pulls/120460
This adds operators to add a bezier and circle primitive in curves
edit mode. The operators support the same settings as in the
legacy curve edit mode. The `shift+A` shortcut is added as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/120513
`BKE_animdata_fix_paths_rename` would tag the owner ID itself
(`ID_RECALC_SYNC_TO_EVAL`) upon renaming when a corresponding fcurve was
found/fixed, however the action itself wasnt tagged. "The action is an
own datablock, meaning, changes to f-curves need to copy those changes
to all evaluated versions of the action datablock" (wording from
4045730d58).
(this is also the reason the action would "fix" itself after entering
tweakmode on it in the NLA, since that ripples down to
`ANIM_list_elem_update` -- which does the tagging on the action then).
Part of #104055
Pull Request: https://projects.blender.org/blender/blender/pulls/120292
Collections which were pointed by a modifier used to follow visibility of the
current object, and this visibility is static throughout the lifetime of the
dependency graph.
Change the code so that collections pointed by modifiers rely on the visibility
flushing, allowing to be optimized out from evaluation.
Pull Request: https://projects.blender.org/blender/blender/pulls/120516
`editmesh_active` theme is used to for active mesh element.
`vertex_active` is unused here (only used in graph editor) so remove it
from the 3d viewport and UV editor theme.
Found this in #119640
Pull Request: https://projects.blender.org/blender/blender/pulls/119649
Instead of using `MEM_callocN` to create an array of `BeztMap`
use a `blender::Vector`. This has the advantage that we don't need to worry about
freeing the memory.
In addition to that it can be passed as a `Span`, removing the need to pass the
length as a separate argument.
Doing that also allows to use the C++ syntax for `for` loops.
This also gives a small performance boost
| Before | After |
| - | - |
| 288ms | 260ms |
Pull Request: https://projects.blender.org/blender/blender/pulls/120507
MoltenVK original intent was to let developers work on a mac system developing
for the vulkan eco-system. MoltenVK doesn't support all the features that we
require and would require additional workarounds to be actually supported.
It is not expected that we will release Blender with MoltenVK for this reason.
But it still has value for shader developers to validate shaders on metal and
vulkan on a single platform.

Pull Request: https://projects.blender.org/blender/blender/pulls/117940
Specializing other frequently used film parameters
results in an additional ~20% uplift in film pass
performance. Measured on Apple Silicon.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/119736