Cycles uses pixel buffers to update the display. Due to making things
work the vulkan backend downloaded the GPU allocated pixel buffer to the
CPU, Copied it to a GPU allocated staging buffer and update the display
texture using the staging buffer. Needless to say that a (CPU->)GPU->CPU->GPU
roundtrip is a bottleneck.
This PR fixes this by allowing the pixel buffer to act as a staging
buffer as well.
Viewport and final image rendering performance is now also similar.
| **Render** | **GPU Backend** | **Path tracing** | **Display** |
| ---------- | --------------- | ---------------- | ----------- |
| Viewport | OpenGL | 2.7 | 0.06 |
| Viewport | Vulkan | 2.7 | 0.04 |
| Image | OpenGL | 3.9 | 0.02 |
| Image | Vulkan | 3.9 | 0.02 |
Tested on:
```
Operating system: Linux-6.8.0-49-generic-x86_64-with-glibc2.39 64 Bits, X11 UI
Graphics card: AMD Radeon Pro W7700 (RADV NAVI32) Advanced Micro Devices radv Mesa 24.3.1 - kisak-mesa PPA Vulkan Backend
```
Pull Request: https://projects.blender.org/blender/blender/pulls/133485
This is due to missing depsgraph update and notifiers to redraw the
viewport region. `ensure_selection_domain` returns false when entire
domain elements are/ain't selected. This makes the `changed` boolean
false that further prevents update calls. Now fixed with bitwise
condition.
Pull Request: https://projects.blender.org/blender/blender/pulls/133463
Prior to this commit, the Fade Inactive Geometry overlay would inspect
the active object and compare each other object's mode and hide them if
they did not share the same mode.
This was incorrect in the following case:
* If multiple objects were all in similar modes, as can be the case
with "Lock Object Modes" off, or with multi-edit mode, then objects
would remain unfaded if they shared the same mode as the active
object.
To fix this, we explicitly check for both the active and the "other"
object being in edit mode and avoid fading in this case.
Ref: #87704
Pull Request: https://projects.blender.org/blender/blender/pulls/132255
The recent addition of DEG_disable_visibility_optimization in #133358
almost fixed this, but it was not fully working. By ensuring objects
are evaluated we avoid modifying original objects.
If for some reason (like a Python handler) the object is still missing,
report an error in the bake operator.
Pull Request: https://projects.blender.org/blender/blender/pulls/133439
This commit adds a unit test for the `bke::pbvh::Tree::from_mesh` method
covering the basic mesh usecase. Further work to add the multires
and BMesh versions will come in subsequent commits.
Pull Request: https://projects.blender.org/blender/blender/pulls/133074
If a USD file has joint indices outside the range of the joints list,
it's possible for our code to assert or crash depending on build
configuration.
One particular file had 289000 indices, nearly all of which were outside
the list which contained just 1 joint value. Instead of continuing when
this is detected, trace an error and immediately return as it's probably
unsafe to continue. This also resulted in many thousands of warning
traces before.
Pull Request: https://projects.blender.org/blender/blender/pulls/133419
These geometry types don't work properly with attributes currently,
so the persistent base isn't really "persistent" and doesn't last after
exiting sculpt mode, but it's still useful for it to work within a
sculpt session. Enable that by adding temporary array storage in
`SculptSession`. During the sculpt refactor project I mistakenly
assumed that this didn't work well enough that anyone would use it.
Pull Request: https://projects.blender.org/blender/blender/pulls/133410
In the Outliner, draw the text of active collections, scenes, and view
layers in "text highlight" color, by default a brighter white than the
regular items. This helps differentiate the active ones a bit better
and also allows them to be themed separately.
Pull Request: https://projects.blender.org/blender/blender/pulls/133390
Especially through DRW_render.hh, there were a lot of unnecessary
includes almost everywhere in the module. This typically makes
dependencies less explicit and slows down compile times, so switch
to including what files actual use.
Pull Request: https://projects.blender.org/blender/blender/pulls/133450
Fixes: #132422, #133288.
`ED_area_init()` is called when the editor in an area changes, this also changes
the available regions. That means, region polling needs to be executed. The
crash was happening because that wasn't the case, and the asset shelf region was
initialized before the polling was executed, which allocates region data in the
`on_poll_success()` callback.
Also had to pass context to `ED_area_init()`, which is an annoyance, but should
be fine. Similar functions like `ED_area_exit()` take it too.
Pull Request: https://projects.blender.org/blender/blender/pulls/133388
Fairly weird, debug builds were fine, but release ones with clang 19
and mold failed at linking step, complaining about misisng
`bNode::output_sockets()` symbol.
Guess debug config somehow pulls this symbol from somewhere else?
Since 4cf7fc3b3a (where a storage handling being added) a render layer node never has persist storage data.
And even more, some code of node update do use storage field as temporal variables for a callback so no any data can live forever in this place.
No one copy/initialize/free callback of the node also does not deal with node storage.
And compositor code also don't know about node storage since use different data from a node (id and custom1 fields).
Pull Request: https://projects.blender.org/blender/blender/pulls/132717
When right clicking on any of the image editor tool buttons,
`WM_keymap_guess_from_context` would be called but lack of `space_type`
will cause `WM_keymap_find_all` to return `nullptr`. Assigning it to
`SPACE_IMAGE` fixes the issue.
Mask layers were added (unnecessarily) in these cases:
- calling `Mask Slice` without having a mask even (now return
`OPERATOR_CANCELLED` early)
- calling `Mask Extract` without having a mask even (now return
`OPERATOR_CANCELLED` early)
- `Extract Face Set` was also adding a mask layer (only because both
extracts used `geometry_extract_apply`), moved mask specific stuff into
`paint_mask_extract_exec` (see above also)
Came up in !123888
Pull Request: https://projects.blender.org/blender/blender/pulls/133435
This reverts commit 19e9092cb6. The
minimum requirement is for builds that Blender officially provides. We
still need to maintain code for none SSE builds.
`TextVars::text` is only 512 bytes and does not include string ending
byte, and `sequencer_text_edit_paste_exec` uses a very simple truncation
that didn't guarantee valid UTF-8 sequence at the end. This is now fixed
by using `BLI_str_utf8_invalid_strip` after truncating the string.
Pull Request: https://projects.blender.org/blender/blender/pulls/133416
After confirming a cut, the tool goes into `MODE_IDLE`.
In `knifetool_undo`, the `KnifePosData` `prev` (drawn as the "red point"
in question in `knifetool_draw`) was only set to the `KnifeUndoFrame`
pos when we are in `MODE_DRAGGING` though -- this is now changed to also
be done for `MODE_IDLE`.
NOTE: it might be questionable to even draw this bigger red dot once a
cut is confirmed (will attach another small diff to the PR that does
this)
Pull Request: https://projects.blender.org/blender/blender/pulls/133430
* Some libraries like Alembic and OpenColorIO for a long time removed
header dependencies on Boost.
* No need to have BOOST_LIBRARIES anymore, only BOOST_PYTHON_LIBRARIES
is a direct dependency through USD headers.
* OpenVDB is no longer a static library, no need to link its dependencies.
Pull Request: https://projects.blender.org/blender/blender/pulls/133424
Having a small voxel size meant typing in zero would clamp the
voxel size to a small number which was often small enough to hang
calculating large voxels which would eventually fail to allocate
memory & crash.
Instead, allow a zero value but bypass calculation.
See #130526.
Reason for this is that all the brushes in essentials assets have a zero
default `mask_stencil_pos` / `mask_stencil_dimension`.
At that time, they have been created resetting a brush to defaults and
using that as a starting point.
At that time though, these settings didnt have a default (which
b2dd308dca fixed, so that method should not result in those settings
being zero).
The brushes in essentials assets still do though, now correct these in
versioning code.
Pull Request: https://projects.blender.org/blender/blender/pulls/133374
Behavior was not consistent across modifiers
- Opacity
-- strokes were using inverted weights only when
MOD_GREASE_PENCIL_OPACITY_USE_WEIGHT_AS_FACTOR was OFF, fills however
when MOD_GREASE_PENCIL_OPACITY_USE_WEIGHT_AS_FACTOR was ON
- Tint
-- strokes and fills were using inverted weights only when
MOD_GREASE_PENCIL_TINT_USE_WEIGHT_AS_FACTOR was ON
- others (Envelope, Lattice, Noise, Offset ) were ignoring inverting the
influence vertex group alltogether (but that is reported in #133055 and
will be handled separately, see below)
- others (Hook, ... ) were always inverting it, which is correct
This pull requeset only corrects this for Opacity and Tint (in the way
that now weights are always inverted, no matter if "Use Weight As
Factor" is used).
This also paves the way to a more general fix for #133055 (which intends
to move the weight inversion to the very general
greasepencil::get_influence_vertex_weights)
Pull Request: https://projects.blender.org/blender/blender/pulls/133310
Without boost::locale, there seems no particular reason to modify the
global locale, we can just translate strings ourselves.
Other locale facets like numeric and time are also left unchanged
from the default, which is the "C" locale. This appears to match
previous Blender behavior with boost::locale. That protects against
bugs where formatting floats for I/O unexpectedly depends on the
system language.
Pull Request: https://projects.blender.org/blender/blender/pulls/133347
This bug occurs when the user deletes the rightmost stop on a
color ramp with 2 stops. After doing this, the color ramp appears
to stop updating its results.
This bug is due to a shader optimization for color ramps. For ramps
with 2 stops or less, the first and second stops are hardcoded as
inputs to get the results of the color ramp. When deleting the
rightmost stop, the stop's data isn't actually changed. The ramp
just updates its total stop number. Because of this, the result of
the color ramp won't change.
This is fixed by only allowing this optimization when a ramp has
exactly 2 stops. This solution works well since it keeps color ramp
code neat and concise. It also makes more logical sense to only allow
this optimization to work with 2 stops since it uses 2 hardcoded values
from the color ramp. It's also unlikely this will lead to adverse
performance problems since it doesn't make sense to use a color ramp
with 1 color stop. In that case, the user should just use an RGB node.
Another possible solution for this problem would be to update the data
for the second stop in the color ramp to exactly match the first when
deleting the second stop. However, this is undesirable since the code
wouldn't make much sense to those who don't know about the color ramp
optimizations.
Pull Request: https://projects.blender.org/blender/blender/pulls/132951
`BKE_unit_value_as_string` was modified in e949ff7334
to include a `BKE_unit_value_as_string_scaled` version, some places on
the interface needs to use the scaled version to show the string, this
includes ruler gizmo length text.
Pull Request: https://projects.blender.org/blender/blender/pulls/133373