Commit Graph

140193 Commits

Author SHA1 Message Date
Philipp Oeser
0d4e2ea40d Fix #126434: Boid particle fight rule crash involving non-boid psys
For the boid Fight rule (and when determining friend/enemy health), we
need to check if other `ParticleTarget` psys is actually boids as well
(their health data is accessed -- which is only present on boid particle
systems), otherwise NULL data access crashes.

I know, EOL, but simple crash fixers should still get a chance to get in
I think.
Could also go into LTSes.

Pull Request: https://projects.blender.org/blender/blender/pulls/126494
2024-08-19 17:01:18 +02:00
Aras Pranckevicius
6d93bf6b44 IMB: Speedups, fixes and cleanups to various image scaling functions
API: merged IMB_scalefastImBuf, IMB_scaleImBuf, IMB_scaleImBuf_threaded
into one function IMB_scale with enum IMBScaleFilter {Nearest, Bilinear, Box}
and bool "threaded" param.

Performance:
- Box filtering (nee IMB_scaleImBuf) can be multi-threaded now.
- Nearest filtering (nee IMB_scalefastImBuf) can be multi-threaded now.
  Also fix performance regression on float images caused by fix in #126234
- Bilinear filtering (nee IMB_scaleImBuf_threaded) is several times faster now.

Correctness:
- Nearest and Box filtering: no longer loses half of edge pixels when scaling
  up.
- Box: fixed garbage results (and possible out of bounds reads) for non-4
  channel float images.
- Bilinear: no longer shifts image when scaling up.
- Bilinear: properly filters when scaling down by 2x2.

Test coverage:
- Add gtest coverage for various IMB_scale modes.
- Add a IMB_performance_test performance test, ran manually.

More details, images and performance numbers in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/126390
2024-08-19 16:50:05 +02:00
Weizhen Huang
be0d2e19b5 Fix #115998: Cycles volume too dark when shadow ray visibility is off
when tracing shadow ray through a volume and no hit is registered, we
consider the whole ray segment inside the volume.

However, no hit registered could also happen when the volume is
invisible to shadow ray. We should explicitly check this case and skip
rendering the volume segment instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/126139
2024-08-19 15:52:35 +02:00
Clément Foucault
a6ce1cd9c7 Cleanup: Overlay: Silence warnings 2024-08-19 15:39:58 +02:00
Clément Foucault
e49bc9633b Overlay-Next: Particles
Straightforward port.

Duplicated some shaders for simplicity.

Includes wireframe for hair particle systems.

Functional change: Particle display now honnor line width.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/126456
2024-08-19 15:38:55 +02:00
Jeroen Bakker
ef3ceb3629 Vulkan: Resource Pools
This PR implements #126353; In short: keep discard list as part of swap chain images. This allows
better determination when resources are actually not in use anymore.

## Resource pool

Resource pools keep track of the resources for a swap chain image.

In Blender this is a bit more complicated due to the way GPUContext work. A single thread can have
multiple contexts. Some of them have a swap chain (GHOST Window) other don't (draw manager). The
resource pool should be shared between the contexts running on the same thread.

When opening multiple windows there are also multiple swap chains to consider.

### Discard pile

Resource handles that are deleted and stored in the discard pile. When we are sure that these
resources are not used on the GPU anymore these are destroyed.

### Reusable resources

There are other resources as well like:
- Descriptor sets
- Descriptor pools

## Open issues

There are some limitations that require future PRs to fix including:
- Background rendering
- Handling multiple windows
- Improve CPU/GPU synchronization
- Reuse staging buffers

Pull Request: https://projects.blender.org/blender/blender/pulls/126353
2024-08-19 15:37:48 +02:00
Bastien Montagne
c1aef6b4b0 Cleanup: make format 2024-08-19 14:26:53 +02:00
Pratik Borhade
60a467204c Fix: GPv3: F3 search crash due to weight paint poll function
Mistake in d1f0d71b54
Invoking search menu triggers crash for objects that do not support
vgroups. Adjust poll function to fix this.

Pull Request: https://projects.blender.org/blender/blender/pulls/126495
2024-08-19 13:53:04 +02:00
Bastien Montagne
d3589270d4 I18N tools: disable multi-processing for the time being.
Not sure why, but today I got almost systematic deadlocks in the
ProcessPoolExecutor calls (and similar issues with direct usage of
multiprocessing)... For now synchronous single process will do.
2024-08-19 13:52:48 +02:00
Bastien Montagne
559c048286 I18N: Updated UI translations from git/weblate repository (d44e9bc078c). 2024-08-19 13:52:48 +02:00
Lukas Tönne
78409a3996 Fix #122831: GPv3 keyframe transform crashes on cancel
The `drawing_index` in frame data can become invalid during transform if
a frame overwrites another. This is very difficult to keep track of
explicitly, so instead this fix just "freezes" drawing indices by adding
a user at the beginning of the transform to every existing drawing and
removing it at the end after all frame data has been updated.
No `drawing_index` needs to be updated during the transform.

Pull Request: https://projects.blender.org/blender/blender/pulls/126312
2024-08-19 12:39:15 +02:00
Clément Foucault
7d2672fb5d Fix: EEVEE: Broken overscan with pixel size greater than 1
Stupid sign error.

Fix #124961
2024-08-19 12:32:28 +02:00
Clément Foucault
86e9254a63 Overlay-Next: Wireframe
Straightforward port.

Left out particle hair to a separate patch for consistency
and simplicity.

Grease Pencil is also missing but that's also missing in
main.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/126242
2024-08-19 12:31:08 +02:00
Sergey Sharybin
51461d0561 Cleanup: Spelling of data-block in a comment 2024-08-19 11:54:36 +02:00
Casey Bianco-Davis
1a07c08718 GPv3: Eyedropper tool
This adds the Eyedropper tool to GPv3.

A few changes have been made:

- Added `Brush` mode.
- Set active color in palette.
- Show the palette in the UI.
- Add UI for setting material mode.
- Drag for color accumulation.

Pull Request: https://projects.blender.org/blender/blender/pulls/126211
2024-08-19 11:27:49 +02:00
Omar Emara
ba61fc9326 Compositor: Allow delayed typing for results
This patch allows result to have their types set after construction but
before allocation.
2024-08-19 11:07:12 +03:00
Jeroen Bakker
975dcea23f OpenGL: Enable High Quality Normals for Legacy AMD Drivers
On Legacy AMD devices EEVEE doesn't render any geometry. During testing
we found that it was based on reading normal attribute. Further testing
it was detected that enabling the high quality normals would solve the
rendering.

This is a known issue on legacy AMD drivers. This PR updates the check
to enable the high quality normals workaround for the latest known AMD
legacy drivers (22.6.1/21.Q1.2). Both drivers still have this issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/126483
2024-08-19 09:42:52 +02:00
Campbell Barton
976062c771 Cleanup: use prefix comments before struct members 2024-08-19 11:37:20 +10:00
Campbell Barton
8a7ff41a85 Cleanup: wrap long lines in Python scripts 2024-08-19 10:48:07 +10:00
Campbell Barton
fe6ab4f344 PyDoc: corrections to formatting and resolve warnings
Use RST formatting for doc-strings used in Python API docs
as well as minor corrections, also add links for foreach_get/set.
2024-08-19 10:48:06 +10:00
Harley Acheson
7c68ac258f UI: File Browser Offline and Alias State Icon Position
#125625 moved the File Browser Thumbnail type icon location from the
bottom-left of the thumbnail extent to the bottom-left of the item
bounds. This does the same for the indication of offline and for
shortcut. This adds a new icon for shortcut instead of current use of
ICON_LOOP_FORWARDS, which doesn't look right. The new icon looks like
the Mac Alias arrow, but this also works fine for other platforms.

Pull Request: https://projects.blender.org/blender/blender/pulls/126469
2024-08-18 22:11:53 +02:00
Hans Goudey
b2368b7eb0 Revert "Refactor: Sculpt: Move original position restore to brush deform step"
This reverts commit 93054f9a0e.

I had forgotten the reason for this separate "restore" step before the brush
deform evaluation was because multiple symmetry steps can be processed in the
same BVH node, in which case we can't just overwrite the values from the last
symmetry step.
Fixes #126445.
2024-08-18 15:09:58 -04:00
Clément FOUCAULT
b919887682 DRW: Add assertions for unsupported values
The `draw::Pass` types have different capabilities.
Custom ID and primitive expansion count are now
checked before command recording.
2024-08-18 15:39:06 +02:00
Jesse Yurkovich
2e395d2aac USD: Add test to verify Shape prim import
Verifies all currently supported USD Shape prim types are successfully
imported. Each prim has time sample data authored so the presence of a
Mesh Sequence Cache modifier is also checked.

Pull Request: https://projects.blender.org/blender/blender/pulls/126449
2024-08-18 03:09:57 +02:00
Clément FOUCAULT
7de383ffc6 Fix: Overlay-Next: Volume outline crashing
Caused by using the wrong pass to create the drawcall.
2024-08-17 13:50:53 +02:00
Jacques Lucke
cc01e8a74e Tools: support reference data in coverage report
This adds initial support for showing the difference between old and new coverage
data. The difference is only shown in index.html currently. This is mainly useful
when adding new tests right now, to see the impact.

To use this, rename the `coverage/analysis` folder in the build directory to
`reference`. It will automatically be used by the report script if that reference
folder exists.
2024-08-17 13:36:42 +02:00
Jacques Lucke
2c52852116 Tests: add initial grease pencil geometry nodes test 2024-08-17 13:31:51 +02:00
Jacques Lucke
daeaac0b1c Fix: Tools: correct default open path in coverage report summary
The `/blender` prefix was specific to my local setup and may be different
for others.
2024-08-17 11:33:00 +02:00
Jacques Lucke
5819ba40f0 Fix: Tools: fix coverage summary page when open paths don't exist anymore 2024-08-17 11:29:41 +02:00
Jacques Lucke
20bc346cf0 Fix: remove unnecessary manual user count
`tree_sharing_info_` is automatically user-counted now.
2024-08-17 11:21:55 +02:00
Jonas Holzman
6e72f00d4e Fix: UI: Wrong single editor window titles due to unset area sub-spacetype
This PR moves new area space subtype update to ED_area_newspace so that
it is applied right after a new space is initialized. This is currently
done in rna_Area_ui_type_update, but after rna_Area_type_update.
Without the subtype set this can result in an incorrect titling of
single-area windows.

Pull Request: https://projects.blender.org/blender/blender/pulls/126224
2024-08-17 01:35:52 +02:00
Jacques Lucke
e0b5654655 Cleanup: improve check for whether object has geometry set instances
This speeds up the file from #126391 from 3.2fps to 3.3fps.
2024-08-17 00:58:37 +02:00
Jacques Lucke
5358d1b09a Depsgraph: avoid checking for evaluated object in draw code
This increases playback performance from 2.9fps to 3.2fps in the test file from #126391.

The check is unnecessary in draw code, because we know that the depsgraph
finished evaluation before. These checks were introduced to handle dependency
cycles during depsgraph evaluation.

At some point it may be nice to look into making these checks cheaper to avoid having
to use the unchecked version for performance reasons.
2024-08-17 00:41:31 +02:00
Jacques Lucke
f21a25489f Volumes: speedup extracting dense voxel values
Extract dense voxels if a very memory bandwidth limited task. I get a 10-20%
speedup be reducing the number of threads doing it at the same time.
2024-08-17 00:25:36 +02:00
Jacques Lucke
aa3549f590 Fix: correct place where simplify level is taken into account for volumes
Otherwise it did not take the current frame into account properly when
the volume is a sequence.
2024-08-16 23:40:25 +02:00
Jacques Lucke
50a6be7169 Tools: add frame filter for task isolation 2024-08-16 23:36:20 +02:00
Harley Acheson
aa78d43a05 UI: Multicolor Autokeying Indicator
Show the autokeying indicator (record button) on the Timeline header in
red when enabled. With a white outline on dark theme, or with a black
outline on light theme. The red color is user changeable.

Pull Request: https://projects.blender.org/blender/blender/pulls/126344
2024-08-16 23:16:40 +02:00
Jesse Yurkovich
6932351e23 USD: Add test data for upcoming PointCloud and Shape tests 2024-08-16 13:25:15 -07:00
Harley Acheson
b04c0da6f0 UI: Increase the Editor Edge Move Zone Size
This increases the hit size for the zone that allows resizing editors.
By approximately one more pixel on each side. This should make sizing
a little bit easier, especially with pens. Corner zone and region
reveal zone take precedence so I haven't found any time this causes any
interference.

Pull Request: https://projects.blender.org/blender/blender/pulls/126376
2024-08-16 21:05:38 +02:00
casey bianco-davis
8f386cd308 GPv3: Edit Mode: "Scale Thickness" option
This implements the `use_scale_thickness` setting for GPv3.

Pull Request: https://projects.blender.org/blender/blender/pulls/126213
2024-08-16 19:50:34 +02:00
Sergey Sharybin
359caa3710 Fix #126408: macOS ARM Cycles performance regression
Update macOS sse2neon library to the newer version

Ref #126413
2024-08-16 18:45:08 +02:00
Sergey Sharybin
abb3f2b0eb Build: Upgrade sse2neon
The previous update introduced a regression #126408

This update pulls a fix committed to the upstream:
  https://github.com/DLTcollab/sse2neon/pull/646

Pull Request: https://projects.blender.org/blender/blender/pulls/126413
2024-08-16 18:35:17 +02:00
Jacques Lucke
4493842fe7 Cleanup: use ImplicitSharingPtr for volume tree sharing info
This avoids manual user management.
2024-08-16 17:45:25 +02:00
Jacques Lucke
cebffdc060 Cleanup: simplify using ImplicitSharingPtr for raw ImplicitSharingInfo 2024-08-16 17:36:29 +02:00
Jacques Lucke
eb8fb9e5a4 BLI: improve api for getting memory count
This introduces `MemoryCount` which can be used across multiple
`MemoryCounter`. Generally, `MemoryCount` is expected to live
longer (e.g. over the entire life-time of a cache), while `MemoryCounter`
is expected to only exists when actually counting the memory.
2024-08-16 17:20:19 +02:00
Jacques Lucke
37ca8347a2 BLI: support smart pointer for weak implicit sharing pointer
Previously, one always had to do manual user management for weak users.
2024-08-16 17:20:19 +02:00
Jacques Lucke
e40c3e5662 Geometry Nodes: add memory counting for bake state 2024-08-16 17:20:19 +02:00
Jacques Lucke
42ad0a754a Fix: Tools: add missing display hint 2024-08-16 17:20:19 +02:00
Hans Goudey
4b71496f56 Fix #120145: mesh_new_from_object crash with evaluated object type change
When the preserve_all_data_layers argument was passed, the object
would be reevaluated, assuming the type of the original object data.
However, the evaluated object type can change compared to the
original, so to reevaluate the original mesh we need to check that
the original object was also a mesh object.

Pull Request: https://projects.blender.org/blender/blender/pulls/126407
2024-08-16 16:56:18 +02:00
Christoph Lendenfeld
ff0c097fa1 Fix #126140: Cycle aware keying not working
The issue was that the code path for layered actions never hit the
function `remap_cyclic_keyframe_location`.

The solution is to move that logic into `insert_vert_fcurve`.
My reason for why this is the correct solution is that
the remapping happens on a per FCurve basis, so it should be within `fcurve.cc`.
Doing so ensures that the layered actions also hit that code.

Pull Request: https://projects.blender.org/blender/blender/pulls/126399
2024-08-16 16:43:17 +02:00