Just-introduced in #126390, when source image size is just two pixels
it should not advance to the third pixel after reading the first two.
Was pointed out by randomly failing tests, yay tests.
This commit takes the namespaces used in `sculpt_intern.hh` and splits
them into their own header files to better logically separate data and
avoid pulling in so many transitive dependencies by needing to include
`sculpt_intern.hh`
Actual removal of `sculpt_intern.hh` from other files is pending
further cleanup of the methods contained within.
A quick summary of the other changes included in this commit:
* `enum` to `enum class` cleanup for enums to enable forward
declarations
* `FilterCache` default destructor to allow forward declaration of
other dependent `struct`s contained in `unique_ptr`s
* Cleanup of unused headers
* Move `SculptBoundary` into the `boundary` namespace
* Move misc brush method forward declarations into `types.hh`
For a given `.cc` file that corresponds to a specific `.hh` file, the
header has been placed at the very top to try and ensure that the
needed data is self contained.
Forward declaration is preferred in most of these files outside of the
templates, classes, and structs in BLI headers.
---
Manual testing done:
- Enter Sculpt mode and perform strokes
- Use automasking for some strokes
- Use mesh filter
Pull Request: https://projects.blender.org/blender/blender/pulls/126443
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
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
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
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
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
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
#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
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.
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
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.
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
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
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.
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
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
This patch supports the viewer node in the new CPU compositor. To do
that, the context viewer output mechanism was refactored to allow CPU
storage by utilizing the result class as opposed to a GPU texture.
The reasoning in the comment applies to "Save as..." as well, because
the destination file becomes the active one and opened data and active
file on disk match.
When saving a copy the active file is not updated, so existing
compatibility issues would remain.
Pull Request: https://projects.blender.org/blender/blender/pulls/126266
Over the year, changes in how image packedfiles were handled broke the
fallback case of missing packed data in a few places, this commit fixes
proper cleanup of invalid packed files in the Image's list of
packedfiles.
In addition, also do not create inplicit sharing info when the read data
is `nullptr`.
The second time the operator ran without a depdency graph
evaluation happening for another reason, the object's evaluated
transform matrices weren't calculated. The fix is to make sure the
depsgraph is evaluated when the operator is executed.
Cancel operator when active vgroup is locked.
Use new poll function to check if vgroup exists, otherwise grey out the
operator.
And some cleanup.
This addresses the points from !126275
Pull Request: https://projects.blender.org/blender/blender/pulls/126313
The issue was that the animation filtering code for layered actions did not take
the `ANIMFILTER_FOREDIT` and `ANIMFILTER_SELEDIT` flags into account.
This also fixes another issue where it was possible to select and edit keys
on locked fcurves.
Pull Request: https://projects.blender.org/blender/blender/pulls/126373
Needed to implement GPv3 version of "Bake Object Transform to Grease
Pencil"
Doesn't implement the `Surface` option, as that is not used in the
previously mentioned operator.
Pull Request: https://projects.blender.org/blender/blender/pulls/126255