Cleanup and simplification of GPUMaterial and GPUPass compilation.
See #133674 for details/goals.
- Remove the `draw_manage_shader` thread.
Deferred compilation is now handled by the gpu::ShaderCompiler
through the batch compilation API.
Batch management is handled by the `GPUPassCache`.
- Simplify `GPUMaterial` status tracking so it just queries the
`GPUPass` status.
- Split the `GPUPass` and the `GPUCodegen` code.
- Replaced the (broken) `GPU_material_recalc_flag_get` with the new
`GPU_pass_compilation_timestamp`.
- Add the `GPU_pass_cache_wait_for_all` and
`GPU_shader_batch_wait_for_all`, and remove the busy waits from
EEVEE.
- Remove many unused functions, properties, includes...
Pull Request: https://projects.blender.org/blender/blender/pulls/135637
For IDProperties, this flag is mostly used only to controll whether
IDProperty code should also handle ID refcounting or not (through
`LIB_ID_CREATE_NO_USER_REFCOUNT`).
Without this fix, IDProp Group Merge could end up trying to modify ID
refcount of its data-block properties (via `IDP_FreeProperty`), which
can lead to data corruption or even crashes (e.g. when used in readfile
code, before lib-linking process).
Issue discovered while working on the system IDProperties split project
(!135807).
Pull Request: https://projects.blender.org/blender/blender/pulls/139230
This converts the public `uiItemFullO` function to an object oriented
API (an `uiLayout::op` overload), matching recents changes in the API.
Changes includes the removal of the paramether `IDProperty *properties`
that seems unused (all places just sets `nullptr`, can be added as last
argument with `nullptr` as default value though), and instead of using a
return paramether the function now returns the pointer to write properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/138961
Our IME input system relied on passing around pointers to global variables.
However this will not work as the Wayland input handling is multithreaded so the content of the global variable would change while the event loop were reading the data.
Pull Request: https://projects.blender.org/blender/blender/pulls/138871
The issue appears to have been that the same depsgraph is evaluated twice at the
same time. Once by the bake code in a background thread and once by gizmo
related event handler.
This patch fixes it by not running event handlers in locked regions. Generally,
accessing evaluated data while the interface is locked (and thus some baking is
usually going on), is not safe.
Pull Request: https://projects.blender.org/blender/blender/pulls/138806
The conversion from int to float is not supported natively
so it ends up happening beforehand on the CPU or as a
step before the vertex buffer can be used. It's better to just
upload floats in the first place.
Related to:
- 1e1ac2bb9b
- 617858e453
Pull Request: https://projects.blender.org/blender/blender/pulls/138855
Some mice have an additional horizontal scroll wheel. This patch adds support
for receiving such events. By default it is used to scroll 2D editors left and right.
I originally developed this because I was missing it in the spreadsheet, but it
seems to be useful in many other editors too.
It's supported on Linux (Wayland), Windows and macos.
Pull Request: https://projects.blender.org/blender/blender/pulls/138758
This merges the public `uiItemS` and `uiItemS_ex` functions into an
object oriented API (`uiLayout::separator`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code
(or vice-versa), making it almost seamless.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/138826
For as long back as I have tested (2.91) using "Duplicate Area into New
Window" for Outliner when minimized (showing only header) will result
in an invalid area - at least on Windows. The area may have have a
black background, invalid screen area verts, and has the header on the
bottom. This is because it is created in a window that is our minimum
size but initialized smaller, at the height of the area (0-2 pixels).
This PR just adds a small minimum to our blender window creation.
Pull Request: https://projects.blender.org/blender/blender/pulls/138696
This converts the public `uiItemR` function to an object oriented
API (`uiLayout::prop`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/138617
This converts the public `uiItemL` function to an object oriented
API (`uiLayout::label`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/138608
It always was functionality which got committed without proper review
by the module or UI/UX team. It has all sort of UX problems, but it is
also something that will be tricky to support for HDR drawing.
To brings things to a more manageable state the functionality is now
removed.
On Windows and Mac (and with certain backends on Linux), Blender would
always appear to be playing back audio even if there was no timeline
playback. This would sometimes prevent devices from going to sleep or
going into lower power state modes when idling.
For the affected audio backends, we now automatically close the audio
backend after 30 seconds of inactivity.
Pull Request: https://projects.blender.org/blender/blender/pulls/136845
Several small improvements to the layout of the search menu:
* Avoid the separator arrow on highlighted items being cutoff
* Properly center and prevent overlap of the scroll indicator
arrows at the top and bottom
* Improve robustness with different zoom levels
* Overall more unified spacing and margins
This patch was originally authored by Yevgeny Makarov (@jenkm).
Pull Request: https://projects.blender.org/blender/blender/pulls/112422
The size of preview images while dragging from File or Asset Browser is
currently related to the size that they are shown in the thumbnail
lists, sort of, but also based on the column size and with an incorrect
scaling. This PR just makes them a consistent size while dragging,
regardless of their thumbnail size.
Pull Request: https://projects.blender.org/blender/blender/pulls/138350
This adds a version of `BKE_id_new_nomain` that takes the ID type parameter as
template argument. This allows the function the return the newly created ID with
the correct type, removing the need to use `static_cast` on the call-site.
To make this work, I added a static `id_type` member to every ID struct. This
can also be used to create a similar API for other id management functions in
future patches.
```cpp
// Old
Mesh *mesh = static_cast<Mesh *>(BKE_id_new_nomain(ID_ME, "Mesh"));
// New
Mesh *mesh = BKE_id_new_nomain<Mesh>("Mesh");
```
Pull Request: https://projects.blender.org/blender/blender/pulls/138383
This converts the public `uiLayoutSplit` function to an object oriented
API (`uiLayout::split`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.
`uiLayout::split` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.
Pull Request: https://projects.blender.org/blender/blender/pulls/138361
Calling `brush.asset_save_as` both creates an asset and also activates
the corresponding brush. When run while Blender is in background mode,
the `active_tool->runtime` field may be null. To avoid crashing in this
case, check for null when comparing active tool data.
Pull Request: https://projects.blender.org/blender/blender/pulls/138245
When using a tablet an increased gizmo hit-radius was used,
afterwards toggling modifier keys could then re-evaluate the
highlighted gizmo with a smaller radius, meaning that pressing modifiers
caused gizmos to become inactive.
Revert [0] while keeping larger radius for both mouse & tablet motion
from 10 to 12 px (scaled by the UI scale).
[0]: a043a0e74d
This patch fixes an issue where the splash screen width clamping
calculation would result in a very narrow size on HiDPI/Retina
display due to the native pixel size not being taken into account.
Fixed by using the `WM_window_native_pixel_x()` function to obtain
the horizontal window size instead of directly using
`CTX_wm_window(C)->sizex`.
Pull Request: https://projects.blender.org/blender/blender/pulls/137997
This converts the public `uiLayoutColumn` function to an object oriented
API (`uiLayout::column`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.
`uiLayout::column` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.
Pull Request: https://projects.blender.org/blender/blender/pulls/138034
Previously spell checker ignored text in single quotes however this
meant incorrect spelling was ignored in text where it shouldn't have
been.
In cases single quotes were used for literal strings
(such as variables, code & compiler flags),
replace these with back-ticks.
In cases they were used for UI labels,
replace these with double quotes.
In cases they were used to reference symbols,
replace them with doxygens symbol link syntax (leading hash).
Apply some spelling corrections & tweaks (for check_spelling_* targets).
This converts the public `uiLayoutRow` function to an object oriented
API (`uiLayout::row`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.
`uiLayout::row` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/137979
Recent commits ([0], [1]) referenced the last handled event
which is incorrect.
- It represents the previous event (not the event being handled).
- It's documented to only be used by the event queue logic.
Resolve using the current event instead of the last handled.
[0]: a043a0e74d
[1]: 5102880f51
Adjust keymap poll function of markers keymap. i.e. when no marker
exists, return false from the keymap so marker operations are not
invoked from key press. Also check whether marker region is visible.
If its is hidden, we can skip the markers keymap.
Pull Request: https://projects.blender.org/blender/blender/pulls/137803
Null check the operator member as this is documented to be null
and is checked elsewhere in the handler logic.
Co-authored-by: Kabinet0 <m3kabin@gmail.com>
Ref !137506
Simplification of the text on the "Save Startup" Confirmation dialog,
trying to reduce jargon and instead focus on the user effect. Title
of "Overwrite Startup File" and body of "Blender will start next time
as it is now." Similar wording for template startups.
Pull Request: https://projects.blender.org/blender/blender/pulls/134429
It's safer to pass a type so that it can be checked if delete should be
used instead. Also changes a few void pointer casts to const_cast so that
if the data becomes typed it's an error.
Pull Request: https://projects.blender.org/blender/blender/pulls/137404
It is more convenient for math reasons, for Blender to treat a pen tilt
toward the user as a positive angle. This PR just reverses all the
comments about the expected values. And also reverses the values from
WinTab, Windows Ink, and Wayland to match.
Pull Request: https://projects.blender.org/blender/blender/pulls/137636
Operators like smooth weights, or transfer weights are exposed in
weight mode. Their definition has `OBJECT_OT_*` prefix, this appends
shortcuts key on those operators to "object mode" keymap. Use
`WM_keymap_guess_from_context` instead. This will allow new shortcut
keys to relevant keymap when object operator is exposed in 3d view.
Pull Request: https://projects.blender.org/blender/blender/pulls/137519
Pen tilt values come into Blender through ghost platforms and device
drivers with inconsistent and ambiguous directions. This PR codifies
that we consider tilt-x positive values to be rightward, negative
values as leftward. Similarly tilt-y positive is away from the user,
negative is toward the user. Comments are updated to make this clear.
This fixes Windows Ink (currently always returning left and away). This
also reverses the Wayland tily-y values to match. We might still have
to consider a user preference to swap directions if we find differences
within a platform.
Pull Request: https://projects.blender.org/blender/blender/pulls/137501
Shortcut is actually assigned to the operator but inside wrong keymap
("Animation"). When "add shortcut" is invoked for a property within
side panel or properties tab, add the new keyitem to "User Interface"
keymap.
Pull Request: https://projects.blender.org/blender/blender/pulls/137080
We have separate drag movement thresholds, and one is specifically for
tablet pen movement. A movement is not considered a drag (when using
left click select) until this amount is detected. This PR decreases
that amount with pen pressure. This results in more immediate and
responsive behavior that feels quite natural. Whether using RCS or
LCS this also similarly reduces the lag when dragging on numerical
inputs and sliders.
Pull Request: https://projects.blender.org/blender/blender/pulls/136685
This patch makes it so that the theme color is used for the
initial/loading Blender window background color. Unlike what
it may look like, theme settings are well loaded at this point
in the initialization process, which lets us directly use them
for coloring the window background instead of relying on a
default grey color.
This also makes the colored titlebar window decorations (introduced in
#123982 for macOS, #134054 for Windows 11), always blend with the window
instead of looking somewhat broken during window initialization. On the
technical side, this uses the top-bar header background theme color to
ensure this always matches with the color used by the colored titlebar.
Pull Request: https://projects.blender.org/blender/blender/pulls/137425
So far it was only possible to relocate a whole library, now one can
also relocate a single linked ID (pulling in all of its dependencies).
This is essentially linking the new data, remapping local usages of the
old linked data to the new one, removing no more used IDs, and updating
liboverrides if needed.