Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync blender master #4002

Merged
merged 442 commits into from Dec 14, 2023
Merged

Sync blender master #4002

merged 442 commits into from Dec 14, 2023

Conversation

Draise14
Copy link
Collaborator

No description provided.

HansGoudey and others added 30 commits December 8, 2023 09:05
Regression in [0] caused XIM generated key events to assert.

[0]: efef709
When debugging the descriptor sets are unnamed. This PR sets the
active shader name. This helps when debugging so we don't need
to track down the shader it is complaining about.

```
 the descriptor (VkDescriptorSet 0x66da6f0000001c58[workbench_prepass_mesh_opaque_studio_texture_no_clip_1022]
binding 7, index 0) is being used in draw but has never been updated via vkUpdateDescriptorSets() or a similar call.
```

This message direct directly to the shader including what part is
needed to be checked. No need to add break points and that sort
of things.

Pull Request: https://projects.blender.org/blender/blender/pulls/115944
Due to changes in the build environment shader_builder wasn't able to
compile on macOs. This patch reverts several recent changes to CMake files.

* dbb2844
* 94817f6
* 1b6cd93

The idea is that in the near future shader_builder will run on the buildbot as
part of any regular build to ensure that changes to the CMake doesn't break
shader_builder and we only detect it after a few days.

Pull Request: https://projects.blender.org/blender/blender/pulls/115929
Caused by 93f6001 , 1b3cfcc .
Direction flag names was changed but the max value passed to `ENUM_OPERATORS`
wasn't pointing to actual max value.

Pull Request: https://projects.blender.org/blender/blender/pulls/115926
Similar to the legacy operator. Removes strokes with a number of points less than or equal to the "limit" property.
Resolves #113599.

Pull Request: https://projects.blender.org/blender/blender/pulls/115923
When creating Blender events in Win32 message processing we are using
the current time as timestamp. This isn't set until we collect them, so
this might be inaccurate at times of high load. This PR changes to using
the time the message was delivered.

Pull Request: https://projects.blender.org/blender/blender/pulls/115872
Rather than relying on the pointers in `SculptSession` which should be
removed eventually, to avoid redundant state storage.
And improve naming to remove the inconsistent "SCULPT" prefix in
many cases-- removing redundancy between the namespace name
and the function name. The specific names might need to evolve a bit
still, but it's much less annoying not having to type or read the
namespace all the time. I left out some areas with unclear design.
"mesh" reads much better than "me" since "me" is a different word.
There's no reason to avoid using two more characters here. Replacing
all of these at once is better than encountering it repeatedly and
doing the same change bit by bit.
When a property name is shown inside of a numerical input, truncate
with ellipsis if it cannot fit.

Pull Request: https://projects.blender.org/blender/blender/pulls/115958
Duplicating into a new window needs to tag the new area for full
redraw. Otherwise Outliner will try a partial redraw while the
tree is not yet built.

Pull Request: https://projects.blender.org/blender/blender/pulls/115959
Our glyph bounds clipping test will fail for the first character of a
string if that character has negative left-side bearing. This is not
usual but can happen in some designs for lowercase "j" to have the tail
hook under the preceding character.

Pull Request: https://projects.blender.org/blender/blender/pulls/115965
These shouldn't be used when the lambda is non-trivial, it likely
generates too much code and bloats the binary size for no
observable performance gain in these cases.
These functions don't have to know about things like geometry
deformations. As far as they're concerned, they just use the positions
from the argument span instead of the positions stored in the curves.
Adds initial support for File Handler registration with the python API
for design task #68935. File Handlers will allow developers to associate
additional UI behavior and capability to operators traditionally used
only within the file browser.

The initial commit should have no user visible changes, but will serve
as the foundation for providing file drag & drop capabilities to
operators that can manage files (#111242).

See the PR for an example of python usage.
See design task #68935 for remaining work to be explored in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/112466
Fixes #115776

Create a minimal structure that contains the instructions necessary to
copy from one custom data format to another. This structure is similar
to the one used in dfacaf4. It should have been used in
9175d9b, which instead introduced quadratic performance
relative to the number of layers when copying every element.

In this commit, copying the entire mesh and adding new custom data
are explicitly changed to use the new map to speed up copying many
elements at a time.

The non-map attribute copy functions are also changed to check for when
the source and result BMeshes are the same. In that case it's much
faster to call the "same format" function from 9175d9b.

For numbers, the timings are arbitrarily influenced by how many layers
I add in my testing. With 50 or so layers, a 10x difference is easily
observable though.

Pull Request: https://projects.blender.org/blender/blender/pulls/115824
Continuation of fix for #115776. Removes attribute copy functions
that calculate the map inline, this is error prone as it's easy to
call these functions from a loop which may result in poor performance.
When editing inside a meta strip, running the "Set Color Tag" operator
would set the color tag of the top-most meta strip, rather than that of
the intended strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/115950
Caused by not applying the offset to start frame calculation.
Also fixes reverse offsetting of waveform when start offset was
negative - content start frame was used instead of handle frame.
Code had variables `frame_start` and `start_frame` for different purpose
confusing. Variables were sorted and math simplified.

Fixes broken waveform to pixel grid alignment.
The previous fix for #106040 worked with GNOME, it relied on
matching GNOME's internal limits - which isn't fool proof
and could fail in the future.

Resolve by adding a `read` wrapper that reads the requested number of
bytes (when available).
Also use a (void *) data argument, matching `read(..)`.
Assign the `chunk_first` once instead of checking & assigning
each iteration.
WM_cursor_wait is more common and doesn't assume the current cursor
is WM_CURSOR_DEFAULT.
ideasman42 and others added 29 commits December 14, 2023 21:25
This was an attempt to fix a crash resizing windows #107797
(which I can't reproduce), however it didn't fix the issue and meant
that a window would sometimes not reach the desired size,
the maximized window for e.g. would sometimes remain the un-maximized
size.
This was missed during #113504

While the versioning code set the flags correctly,
the defaults were not specified correctly.
This would leave new users to key only location.

Fix it by enabling Location, Rotation, Scale and
Custom Properties by default.

Pull Request: https://projects.blender.org/blender/blender/pulls/116180
This is a replacement for the workflow that uses
"Bake Curve" and "Unbake Curve" to quickly generate
dense key data.

Compared to the existing workflow it has the advantage
of allowing the user more control over the key types,
and distance between keys, as well as the frame range affected.

Operator options

* Range: the range that will be baked.
Defaults to the scene range or preview range.

* Step: Distance between keyframes.
Can be used to bake on 2s or even bake to subframes.

* Remove Existing Keys: Boolean option that
if enabled also removes keys outside the specified baking range

* Interpolation Type: Choose a interpolation mode used
for new keys e.g. Constant or Bezier

* Bake Modifiers: If enabled bakes the effect of the
modifier stack to keys and deletes the modifier stack.
If false, the code disables the modifiers before baking,
so the resulting keys will behave as if the modifiers didn't exist

The operator can be found in the Graph Editor under `Channel->Bake Channels`

Part of: #111050

Pull Request: https://projects.blender.org/blender/blender/pulls/111263
The functionality was added [0] but the flag wasn't enabled.

Ref: !116178

[0]: e5a0d11
The channel_bake_remove_options were forgotten
to be removed. They were no longer in use after
addressing review comments.
This fixes the compiler warning.
Studio lights had gone over several iterations during 2.80. Some
unused options where still in the code, but not used.

This PR cleans up the studio lights to options that are still in use.
Removing:

- Spherical Harmonics: It was used by workbench, but was replaced
  by regular OpenGL lights
- Irradiance textures: Was used by an old eevee world light evaluation
- Cached data files.

Pull Request: https://projects.blender.org/blender/blender/pulls/116186
IMB_transform is used by Sequencer (and other places) to do image
translation/rotation/scale on the CPU. This PR speeds up parts of it,
particularly when bilinear filtering is used. No behavior changes are
expected.

- Don't use virtual function calls inside inner loop. The code was using
  class hierarchies with virtual calls just to do equivalent of "outside
  of image? ignore" and "wrap UV coordinates or not?" decisions. Make those
  use non-virtual function based code.
- Simplify pixel sampling functions to only do the work as needed by
  anything within Blender codebase. For example, bilinear sampling of uchar
  images always uses 4 RGBA channels and never does "UV wrap" logic.
- Bilinear interpolation uchar: completely branchless SIMD code now.
- Bilinear interpolation float: 2x floor() calls instead of 4x floor() +
  2x ceil(), and final sample blending is done with SIMD.

Sequencer at 4K UHD resolution, with two image strips that need a transform,
playback framerate:

- Windows Ryzen 5950X: 18.7fps -> 26.2fps (IMB_transform time per frame goes
  26.3ms -> 11.2ms)
- Mac M1 Max: 27.3fps -> 31.4fps

At that point the IMB_transform is not the slowest part of where playback
takes time (but rather sequencer effect application etc.).

Note: the amount of _actual code_ got a bit smaller. But I've added 100 lines
of unit tests in BLI_math_interp_test.cc, the bilinear interpolation
functions were only tested very indirectly by CPU compositor template
image tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/115653
`float4x4` requires 16 byte alignment. The compiler can add padding
within the struct, but the allocation needs to know about the alignment
too. Fix by using an allocation function that handles this properly.
Studio lights based on image resources are kept in memory, even when only
displayed as an icon. When having many studio lights configured
leads to allocating a lot of memory that are not used.

This patch free image resources when only icons are requested.
For studio lights that are used in a viewport the image resources are kept.

Pull Request: https://projects.blender.org/blender/blender/pulls/116191
…the process

Now that the code is in C++, quite some duplication between "byte" and
"float" effect code paths can be reduced (easier than it was in C times).
So I did that, removing about 400 lines of code.

In that process I accidentally made Gaussian Blur faster, since while
reducing the amount of code I noticed it was doing some things
sub-optimally (calculated kernel tables for each job, etc.). Applying
100x100 gaussian blur on 4K UHD resolution image strip on Ryzen 5950X
went 630ms -> 450ms.

Pull Request: https://projects.blender.org/blender/blender/pulls/116089
The only user was the Python API. Convert that to use the C++ API.
That simplifies things a bit even, since the encoding of "arrays of arrays"
is a fair amount simpler with the C++ data structures. The motivation
is to simplify the changes from #111061.
Just a little explanation of the code, because I got confused by my own.

No functional changes, except for the addition of a `BLI_assert_msg()`.
Fix error of wrong parameter for `compare_exchange_weak`. Second
one parameter is used for write new value, but a mistake occurred and
the wrong parameter (for read) was used. Default param is enough for
this, so just delete last one.

Pull Request: https://projects.blender.org/blender/blender/pulls/116010
Avoids macro redefinition warnings in unity builds.
Rather than inlining all the logic into OBJ export code
Separate allocation of input arrays and assignment to input class.
The main purpose is to simplify #111061.
Use a local variable for the faces, use range based for loops.
Conflicts Resolved:
	release/text/readme.html
	scripts/startup/bl_ui/properties_render.py
	scripts/startup/bl_ui/space_toolsystem_toolbar.py
	scripts/startup/bl_ui/space_view3d.py
	source/blender/editors/sculpt_paint/sculpt_face_set.cc
	source/blender/editors/sculpt_paint/sculpt_mask_init.cc
	source/blender/nodes/NOD_static_types.h
This `update_vertex_data` only found nodes with the color update
tag and also added redraw tags. But whenever nodes are marked
for a color update, those redraw tags are already set anyway.
It appears this was meant to solve problems switching active
color attributes during undo and redo, but it doesn't make a
difference when this function is removed.
Mainly for semantic reasoning-- these face set gestures don't change visibility.
To prepare for potentially not storing this array in the PBVH.
There were just two more places using the C threading API in sculpt code.
Switch them to the C++ API and remove the settings function.
If the string is shorter than the cut-off length, ensure we always
exit cleanly when we iterate to the very start of the string.

Pull Request: https://projects.blender.org/blender/blender/pulls/116208
Conflicts Resolved:
	scripts/startup/bl_ui/space_dopesheet.py
	scripts/startup/bl_ui/space_graph.py
	source/blender/editors/interface/interface_context_menu.cc
	source/blender/nodes/NOD_static_types.h
@Draise14 Draise14 merged commit 8552d9f into master Dec 14, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet