This speeds up saving the following production file by about 10%:
`240ms -> 220ms`
`heist/pro/shots/060_fight/060_0080/060_0080.anim.blend`
This is a fairly low hanging fruit. Ideally we wouldn't have to duplicate
the string at all, but changing that is a larger undertaking.
Replaces all usage by the the gpu_shader_math
equivalent. This is because the old shader
library was quite tangled.
This avoids dependency hell trying to
mix libraries.
Changes are split into isolated commits until
I had to do mass changes because of inter-
dependencies.
Pull Request: https://projects.blender.org/blender/blender/pulls/113631
There was a little hack to remove padding from buttons following the collapse
icon by setting the `UI_BUT_NO_TEXT_PADDING` flag, since that added excessive,
weird looking spacing. This shouldn't be done for buttons with icons, as it
moves the icons too close to the collapse chevron, and is visibly inconsistent
with other icon labels in the tree.
Turns out, that the entire hack to set the `UI_BUT_NO_TEXT_PADDING` flag is
unnecessary since 5c2330203e, which sets the flag everywhere for comparable
situations. So the hack can be removed.
No functional changes
`ANIM_builtin_keyingset_get_named` had a `KeyingSet *` argument
that was always passed as `nullptr`
This patch removes it to simplify the code.
Pull Request: https://projects.blender.org/blender/blender/pulls/113677
No functional changes
The keying set code was passing around a list
of `tRKS_DSource` through a lot of functions.
It turns it this was just a ListBase wrapper around `PointerRNA`.
So to make it clearer what is passed around, I replaced the
`ListBase` with a `Vector<PointerRNA>`
To make the use of `ANIM_relative_keyingset_add_source` clearer
I made two functions out of it with different parameters.
Those can take the vector as a reference and
EITHER only an `ID *`
OR an `ID *`, `StructRNA *` and a `void *`
Pull Request: https://projects.blender.org/blender/blender/pulls/113675
The goal of this patch is to allow us to use dynamic node declarations
for various nodes in a future version without breaking forward compatibility.
The same kind of change should be added to Blender 3.6.
The code added here is not supposed to end up in `main`, so it has to be
removed when merging the release branch.
Pull Request: https://projects.blender.org/blender/blender/pulls/113497
Create menu similar to legacy GP to expose insert keyframe operation in
user interface. Pressing `I` key will invoke this menu.
(We can further add "key duplicate" and other relevant operation in this menu)
Pull Request: https://projects.blender.org/blender/blender/pulls/113663
No functional changes
Make the code more readable by doing the following
* rename `BKE_keyingset_free` to `BKE_keyingset_free_paths` since that is what it does
* invert `if` and return early to reduce indentation
* add enum value `MODIFYKEY_SUCCESS` to explicitly state the return value, instead of eModifyKey_Returns(0)
* return `INSERTKEY_NOFLAGS` instead of eInsertKeyFlags(0)
* move variables closer to their usage
Pull Request: https://projects.blender.org/blender/blender/pulls/113666
When drawing the image editor the depth of the geometry is set to -1.
This will be clipped in Vulkan, but is valid in OpenGL. This PR patches
the shader to be inside the range that both Vulkan and OpenGL support.
This ensures that images are visible in the image editor.
Pull Request: https://projects.blender.org/blender/blender/pulls/113668
Shaders that require transform feedback should not be validated on
backends that don't support transform feedback.
In Vulkan transform feedback is implemented as an extension and
supported by half of the platforms. It isn't decided yet if we want to
support transform feedback as it is currently used as a fallback for
hair compute shader. In vulkan compute is available on all platforms.
During validation the shader printed a not implemented message.
This change hides that message.
Pull Request: https://projects.blender.org/blender/blender/pulls/113655
When running Blender inside renderdoc an extension can be used to print
from any shader stage to the console. This is useful during developing,
but not so during running/triaging. For now we remove the extension to
not confuse by incorrect error messages.
Pull Request: https://projects.blender.org/blender/blender/pulls/113654
This commit makes using (most of) `BKE_report` API safe in
multi-threaded situation.
This is achieved by adding a `std::mutex` lock to the `ReportList`
struct (in a slightly convoluted way unfortunately, due to this being a
DNA struct). This lock is then used to make most operations on
`Reportlist` data thread-safe.
Note that while working on this, a few other minor issues aroze in
existing usages of Reportlist by the WM code, mainly the fact that
`wm_init_reports` and `wm_free_reports` were both useless:
- init was called in a context where there is not yet any WM, so it
was doing nothing.
- free was called on a WM that would be later freed (as part of Main
freeing), which would also call cleanup code for its `reports` data.
Both have been removed.
Further more, `wm_add_default` (which is the only place where a WM ID is
created) did not initialize properly it reports data, this has been
fixed.
This change is related to the wmJob thread-safety tasks and PRs (#112537,
!113548).
Pull Request: https://projects.blender.org/blender/blender/pulls/113561
When Vulkan is started with validation layers the console is flooded.
Somewhere in the Vulkan validation layers or mesa driver (or the
combination) there is an issue where maxBufferSize is reported by the
driver to be 4GB, but the validation layers are reporting any buffer
size to be larger than 4GB.
For now we skip this message to be logged.
Pull Request: https://projects.blender.org/blender/blender/pulls/113652
With the shift to GPU-driven rendering pipeline,
the SSBO vertex fetch paradigm used to
implement workbench shadows on Metal
instead of utilising the geometry shader
path no longer worked correctly.
This is because the draw submission
required vertex amplification up-front,
based on the expected output geometry
amount for a given input geometry.
This WIP patch aims to resolve this
issue through addition of API to
enable the features within the
GPU driven pipeline.
Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/113498
`eevee_shadow_page_tile_store` shader uses `VIEWPORT_INDEX` and `LAYER`.
Both use an optional extension in OpenGL and Vulkan. When the extension
isn't available a geometry shader is injected to emulate the
extension. The generated geometry shader requires `instance_name` to be
set. This wasn't the case for `eevee_shadow_page_tile_store` shader.
This PR also adds a detection for incompatible shader infos.
- Shaders that use `VIEWPORT_INDEX` or `LAYER` cannot have a geometry stage.
This check is done in debug and release builds.
- Shaders that use a fallback shader should have instance names set in
the stage interfaces. This check is only done in debug builds.
Pull Request: https://projects.blender.org/blender/blender/pulls/113649
This PR adds workarounds for platforms that don't support `shaderOutputLayer`
or `shaderOutputViewportIndex`. Some NVIDIA laptop GPUs and ARM GPUs don't
have those device features.
The workaround uses the same approach as OpenGL. A geometry shader is injected
to emulate the feature.
For testing the workarounds they have also been connected to the
`--debug-gpu-force-workarounds` command line argument.
Fixes#113475 by implementing #113529
Pull Request: https://projects.blender.org/blender/blender/pulls/113605
For node search that means that shorter matching node names
are moved further to the top, even if the entire search result is longer
because it is in a deeper menu.
This also more closely resembles how the search worked in Blender 3.6
where the menu path was not included in the search.
Significantly reduce the amount of manual memory management by
replacing owning pointers with `blender::Array`. This also simplifies
counting the size of the undo steps and iterating over the array values
in some cases.
Resolve issues with the animation player drag & drop.
- IMB_exit ran before attempting to load the dropped image,
crashing when the image was loaded.
- The old event consumer wasn't removed from the system
causing events to be processed that accessed freed stack memory.
Resolve issues with the animation player drag & drop.
- IMB_exit ran before attempting to load the dropped image,
crashing when the image was loaded.
- The old event consumer wasn't removed from the system
causing events to be processed that accessed freed stack memory.