7 Commits

Author SHA1 Message Date
Omar Emara
39d0cff1dc Refactor: Compositor: Remove initial reference count
This patch removes the initial reference count mechanism from the Result
class. That's because results are no longer cached across evaluations
ever since 97ada4f307, so it is no longer useful.

Pull Request: https://projects.blender.org/blender/blender/pulls/135526
2025-03-06 08:50:22 +01:00
Omar Emara
b03e9be22d Refactor: Compositor: Assert for unneeded allocations
This patch refactors how the compositor deals with outputs that are
allocated but not needed. Previously we allowed such allocations and
implicitly release them right after operations are computed. This is a
weak design, so we now require developers to only allocate outputs that
are actually needed and assert otherwise. The release mechanism is
therefore removed.
2025-03-04 15:05:41 +02:00
Omar Emara
8dbd607df5 Merge branch 'blender-v4.4-release' 2025-02-17 16:57:36 +02:00
Omar Emara
003fb98f9d Fix #134567: Compositor memory leak in some setups
The compositor leaks memory in certain setups where a transformed result
is linked to two inputs in the same pixel node. This happens due to an
overestimation in the computation of reference counts of those results.
Since pixel operations might share the same input for multiple links in
the node tree, the reference count should be corrected to take that
sharing into account.

This sharing was previously accounted for as part of releasing inputs in
the pixel operation, but input processors didn't take that into account,
so the realize on domain input processor would leak memory. So to fix
this, we correct the reference count at the evaluator level instead,
such that input processors can safely operate on the correct reference
count.

Pull Request: https://projects.blender.org/blender/blender/pulls/134666
2025-02-17 15:55:22 +01:00
Omar Emara
89e0472e49 Compositor: Use gpu::TexturePool instead of DRW pool
This patch removes the compositor texture pool implementation which
relies on the DRW texture pool, and replaces it with the new texture
pool implementation from the GPU module.

Since the GPU module texture pool does not rely on the global DST, we
can use it for both the viewport compositor engine and the GPU
compositor, so the virtual texture pool implementation is removed and
the GPU texture pool is used directly.

The viewport compositor engine does not need to reset the pool because
that is done by the draw manager. But the GPU compositor needs to reset
the pool every evaluation. The pool is deleted directly after rendering
using the render pipeline or through RE_FreeUnusedGPUResources for the
interactive compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/134437
2025-02-12 15:59:45 +01:00
Aras Pranckevicius
496a3749d7 Cleanup: rename namespace realtime_compositor->compositor
Pull Request: https://projects.blender.org/blender/blender/pulls/132008
2024-12-17 11:39:04 +01:00
Aras Pranckevicius
a401089a9d Cleanup: move compositor files out of realtime_compositor folder
By now it is just a "compositor", so move the files one folder up.
Things that were under realtime_compositor/intern move into
already existing intern folder.

Pull Request: https://projects.blender.org/blender/blender/pulls/132004
2024-12-17 10:34:24 +01:00