Fix #112164: Draw: Circle select tool low performance #113024

Merged
Miguel Pozo merged 1 commits from pragma37/blender:fix-112164 into blender-v4.0-release 2023-10-02 16:43:56 +02:00
Member

Since garbage collection of texture pools happens every time drw_manager_init is called, interleaved calls to different DRW_draw/DRW_render functions can result in a constant cycle of creating/releasing textures.

This PR changes texture pools to only release textures that have not been used for N garbage collection cycles.
I choose 8 as default since I think is high enough to avoid the issue while it's unlikely to cause any major spike in memory consumption.

Since garbage collection of texture pools happens every time `drw_manager_init` is called, interleaved calls to different `DRW_draw`/`DRW_render` functions can result in a constant cycle of creating/releasing textures. This PR changes texture pools to only release textures that have not been used for N garbage collection cycles. I choose 8 as default since I think is high enough to avoid the issue while it's unlikely to cause any major spike in memory consumption.
Miguel Pozo added 1 commit 2023-09-28 17:19:06 +02:00
Miguel Pozo added this to the EEVEE & Viewport project 2023-09-28 17:19:22 +02:00
Miguel Pozo added the
Module
EEVEE & Viewport
label 2023-09-28 17:19:28 +02:00
Miguel Pozo added this to the 4.0 milestone 2023-09-28 17:19:32 +02:00
Miguel Pozo requested review from Clément Foucault 2023-09-28 17:19:41 +02:00
Clément Foucault approved these changes 2023-09-30 09:21:22 +02:00
Miguel Pozo added 104 commits 2023-10-02 16:38:49 +02:00
buildbot/vdev-code-daily-coordinator Build done. Details
ab26ddc455
Revert "Release cycle: Bcon3 for Blender 4.0"
This reverts commit 8c25952886.
buildbot/vdev-code-daily-coordinator Build done. Details
b5f6c00f0a
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
6caa8010d0
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
d98005da5d
Fix #112180: Noise with high detail and lacunarity outputs erratic values
This patch fixes #112180 by aligning the floor fraction function with
the GLSL/SVM ones, through the use of the floor math function.

Pull Request: #112962
buildbot/vdev-code-daily-coordinator Build done. Details
f217380128
Realtime Compositor: Use Int2 images in JFA algorithm
This patch changes the image type used in the Jump Flooding Algorithm to
be Int2 instead of Float4. That's because we used to store the distance
along with the texel location, which we no longer do, so we are left
with the 2D texel location only which can be stored in an Int2 image.

We no longer store the distance because it is not necessarily needed, it
introduces a sqrt in each of the JFA passes, and it is less precise due
to storage in 16F images. Developers should compute the distance in the
user shader instead.

This is a non-functional change, but results in less memory usage,
higher performance, and higher precision.

Pull Request: #112941
buildbot/vdev-code-daily-coordinator Build done. Details
77e60a4eb6
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
a0b1d31e59
Merge branch 'blender-v4.0-release' into main
buildbot/vdev-code-daily-coordinator Build done. Details
2286b77730
Merge branch 'blender-v4.0-release' into main
buildbot/vdev-code-daily-coordinator Build done. Details
b373eb6024
Merge branch 'blender-v4.0-release' into main
buildbot/vdev-code-daily-coordinator Build done. Details
2da37d3b76
Merge branch 'main' into blender-v4.0-release
a3698d0577 Cleanup: Move sculpt mask update to a separate function
There's no reason to use a general "update vertex data" function,
that just confuses things.
406de58674 Fix #112817: Nodes incorrectly "fully masked" after expand face sets
The expand operator reused `SCULPT_UPDATE_MASK` even when it
changed face sets, not the mask. That triggered incorrect behavior in
`node_update_mask_redraw` when there was no mask layer, which caused
nodes to be incorrectly marked as fully masked (and therefore optimized
out of later operations).
buildbot/vdev-code-daily-coordinator Build done. Details
a493c72d88
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
f03a015049
Merge branch 'blender-v4.0-release'
9e5cf73b4d Cleanup: Make PBVH iter mask not a pointer
After 97f2b01ea9, the iterator's mask data is just read only,
so there's no point in storing it as a pointer. This simplifies the code
using the mask data, since the default only needs to be handled once.
buildbot/vdev-code-daily-coordinator Build done. Details
afaa30b1eb
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
14c233d788
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
8edd706cde
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
cfc4dc2379
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
a34d53cf6f
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
ca9c6372c9
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
8b6b71a47f
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
e5a33b3b2c
Vulkan: Rework Initializing/Allocating Textures
When initialy adding textures it wasn't possible to allocate during
initialization as its usage wasn't known. Bot Metal and Vulkan would do
a delayed allocation adding more checks when using textures.

Recently the behavior of setting texture usage was changed and now is
known when initializing textures. This PR makes advantage of this to
give correct feedback to the calling code if the texture can be created
and remove all the delayed allocating of textures.

Pull Request: #112997
buildbot/vdev-code-daily-coordinator Build done. Details
ad93324580
Vulkan: Add support for Framebuffer Depth Blit
This PR adds support for `GPU_framebuffer_blit` When used with `GPU_DEPTH_BIT`.
The challenge with is that not all GPUs support using a depth texture as a blit destination.

An AMD GPU doesn't support a depth buffer with stencil buffer as blit destination.
![image](/attachments/130e7e38-2dbc-4653-950c-2234bd5bad52)
> NOTE: AMD GPUs don't support 24 bit unsigned normalized depth textures at all.

In all cases when we use depth blitting we are blitting the whole texture
and in stead we can use a texture copy.

A negative effect is that we need to unbind the framebuffer when copying
depth textures, but a positive effect is that we can use a data transfer function what should
theoretically be faster.

This should be revisited when we are investigating in areas to improve the
performance of the Vulkan backend.

Pull Request: #112674
buildbot/vdev-code-daily-coordinator Build done. Details
035209fb8f
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
9fcc8de68f
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
e64db67fa5
GPU: Add platform parameter for GPU architecture
Authored by Apple: Michael Parkin-White

Pull Request: #112566
buildbot/vdev-code-daily-coordinator Build done. Details
446ff8a321
Merge branch 'blender-v4.0-release'
5024c0ef97 Refactor: Move NLA anim bake paremeters into dataclass
The `bake_action` (and subsequent methods) for NLA action baking have a long parameter lists. Refactoring to move the bake options into a data class.

Pull Request: #112865
buildbot/vdev-code-daily-coordinator Build done. Details
8d556733b3
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
df63825cee
Merge branch 'blender-v4.0-release'
d33eb78de3 3D View: Do not recalculate the depth buffer for 'Auto Depth'
This is a solution to avoid redrawing the depth buffer for each Zoom
with `Auto Depth`.

The solution is to move the `ED_view3d_depth_override` function out of
`ED_view3d_autodist`.

`ED_view3d_depth_override` is now only called for navigation operations
if it does not meet the following condition:

```
    bool has_depth_buffer = !(v3d->flag2 & V3D_HIDE_OVERLAYS) ||
                            ELEM(v3d->shading.type, OB_SOLID, OB_MATERIAL) ||
                            XRAY_FLAG_ENABLED(v3d) ||
                            v3d->shading.type == OB_RENDER &&
                                (strcmp(DEG_get_evaluated_scene(depsgraph)->r.engine,
                                        RE_engine_id_BLENDER_EEVEE) == 0 ||
                                 strcmp(DEG_get_evaluated_scene(depsgraph)->r.engine,
                                        RE_engine_id_BLENDER_WORKBENCH) == 0);
```
buildbot/vdev-code-daily-coordinator Build done. Details
b5599fed3d
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
7dafe2e6e5
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
3111ac4e96
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
5406a4095b
Merge branch 'blender-v4.0-release'
4618912ba6 Fix mouse cursor failing to update for blocking actions on Wayland
Changes to the mouse cursor would only display when the main loop
was being handled, so blocking actions such as file load wouldn't
refresh the cursor.

Solve by flushing the display when the cursor changes.
buildbot/vdev-code-daily-coordinator Build done. Details
19fd4a51a9
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
42bd9cd1e6
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
0afdd5c248
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
f97a56eedd
Vulkan: Fix Blitting Extents
During Blitting it is not allowed to read/write outside
the texture bounds. This patch ensures that the bounds
(called extents in Vulkan) are inside the expected range.

Pull Request: #113050
buildbot/vdev-code-daily-coordinator Build done. Details
9e25ac676b
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
dd5b870d15
Anim: Add channel type options to the Bake Action operator
Currently, we're limited to the type of Bake Data, without any control over the channels that get baked.

With this change, the user now has a fine degree of control as to which types of f-curve data will be written to the baked action (i.e., location, rotation, scale & b-bone channels).

Co-author  @cmbasnett

Pull Request: #111997
buildbot/vdev-code-daily-coordinator Build done. Details
7340bdaa92
Merge branch 'blender-v4.0-release'
6c14764f32 Fix #112933: Fix codegen issue on MSVC 17.7
MSVC 17.7 generates bad code in some lambda's, this has been reported
upstream [1], and a workaround has been suggested by MS in the form of
turning the inliner off. In consultation with the geo nodes people this
was deemed a passable solution, there was only a single call to this
method so performance wasn't a concern, so no special care had to be
taken to single out just the problematic MSVC versions.

If this bug pops up in other parts of our code where performance IS a
concern a more delicate approach may be required.

[1] https://developercommunity.visualstudio.com/t/10448291

Pull Request: #112616
1c9d7d5267 Fix reported build failure due to missing ostream include
On FreeBSD 13 / clang 15 the missing include apparently does not
get included indirectly, see
#111063 (comment)
buildbot/vdev-code-daily-coordinator Build done. Details
9cbcff97f9
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
73471b4e52
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
c26efccf61
Use bool for each condition
buildbot/vdev-code-daily-coordinator Build done. Details
90ec11b823
Revert "3D View: Do not recalculate the depth buffer for 'Auto Depth'"
This reverts commit d33eb78de3 and c26efccf61

They came in without a review.
buildbot/vdev-code-daily-coordinator Build done. Details
08aa71bfc9
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
63e1d06233
Geometry Nodes: add utility for debug randomization of instances
Also see cc7da09c1b.
buildbot/vdev-code-daily-coordinator Build done. Details
ad50ded7b5
Metal: Fix texture atomic wrapper
GLSL imageAtomic operations operate on single components.
buildbot/vdev-code-daily-coordinator Build done. Details
995aa08c79
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
6f9fb776de
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
4a4b1482cd
GL: Add subpass input emulation
This adds basic emulation of the subpass input feature
of vulkan and to a lower extend Raster Order Group on Metal.

This help test paths that might use this feature in the future
(like shadow rendering) on all platform and or simplify higher
level code for supporting older hardware.

This add clear description to the load/store ops and to the
new `GPUAttachementState`.

The OpenGL backend will correctly mask un-writable
attachments and will bind as texture readable attachments.

Even if possible by the vulkan standard, the GPU API prohibit
the read and write to the same attachment inside the same
subpass.

In the GL backend, this is implemented using `glTextureBarrier`
and `texelFetch` as it is described in the ARB_texture_barrier
extension.
https://registry.khronos.org/OpenGL/extensions/ARB/ARB_texture_barrier.txt

Pull Request: #112051
f30280a1d1 Cleanup: Make format
Formatting changes resulting from Make Format.
9c6e3c80c7 GL: Fix depth clearing with `clear_attachment`
The depth write mask was no always set to true.
8b7bbee14f GL: Add support for loadop
This just do a clear in place for the clear load op.
At least it allows for same result accross backend as
the other op types are only here for performance.
8fe0ffed4e GL: Subpass transition fix with GPU_ATTACHEMENT_IGNORE
GPU_ATTACHEMENT_IGNORE should work on slots that
contain no attachments.
buildbot/vdev-code-daily-coordinator Build done. Details
eda7926834
DRW: Add SubPassTransition pass command
buildbot/vdev-code-daily-coordinator Build done. Details
8a2e81b16b
UI: Anchor Right When Double-Clicking Last Word
In UI text inputs, when double-clicking to select words, anchor (set
initial selection position) to the right if on the last word. This
aids in some combined double-click-drag operations.

Pull Request: #113125
buildbot/vdev-code-daily-coordinator Build done. Details
690a3ddf7e
RNA: support passing template arguments to functions
The goal is to allow passing template parameters in the string that is passed
to `RNA_def_function` in rna code. This can reduce redundancy (e.g. when used
together with #113114). Only "simple" template parameters are supported,
i.e. only ones that do not contain a nested `,`.

Function names passed to e.g. `RNA_def_property_pointer_funcs` and
`RNA_def_property_update` happen to support this already without further changes.

Pull Request: #113121
buildbot/vdev-code-daily-coordinator Build done. Details
3961c49930
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
4c37a962e3
Merge branch 'blender-v4.0-release'
buildbot/vdev-code-daily-coordinator Build done. Details
5573568c12
Cleanup: Make format
buildbot/vdev-code-daily-coordinator Build done. Details
87cc5c1f36
Merge branch 'blender-v4.0-release'
732bfba6b8 Cleanup: Strict compiler arning
Unused function argument in the Metal framebuffer.
buildbot/vdev-code-daily-coordinator Build done. Details
2be3e7c16a
Cleanup: Suppress strict compiler warning for external code
The new Clang which came with XCode 15 introduced the new
warning: -Wsingle-bit-bitfield-constant-conversion. It is a bit
too noisy in the Bullet code.

Since the warning is in the code which we do not maintain suppress
it similar to other similar warnings.

Pull Request: #113136
buildbot/vdev-code-daily-coordinator Build done. Details
7f7e1ab088
GL: Remove Apple platform specific workarounds
We don't ship with OpenGL anymore on Mac platform.
The build option is not even available anymore.

This removes any reference to Apple or Mac in the
Opengl module.

Note that I left the depth_blitting_workaround
even if it originaly meant for Mac because it
might be still useful for other hardware.

Pull Request: #113126
buildbot/vdev-code-daily-coordinator Build done. Details
783058ed6d
RNA: don't generate declarations for templated functions
This reverts 690a3ddf7e and makes it so that we don't even try
to generate the correct declaration for templated functions instead.
The reason for generating these declarations was to detect errors
when calling functions with the wrong signature. However, we still
get compile time errors when trying to call the function with wrong
parameters.

This helps simplifying the code in #113114 even more.
buildbot/vdev-code-daily-coordinator Build done. Details
22bd62c8e0
Merge branch 'blender-v4.0-release'
Miguel Pozo force-pushed fix-112164 from 617bcbf567 to 09e7dfc786 2023-10-02 16:42:02 +02:00 Compare
Miguel Pozo merged commit 0ed6172833 into blender-v4.0-release 2023-10-02 16:43:56 +02:00
Miguel Pozo deleted branch fix-112164 2023-10-02 16:44:00 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#113024
No description provided.