Refactor Render Result to allow implicit buffer sharing #108045

Merged
Sergey Sharybin merged 5 commits from Sergey/blender:render_result_implicit_sharing into main 2023-05-23 09:19:44 +02:00

5 Commits

Author SHA1 Message Date
Sergey Sharybin ab9cbae4db Merge branch 'main' into render_result_implicit_sharing 2023-05-23 09:14:37 +02:00
Sergey Sharybin 2927d2d7e2 Remove unrelated change 2023-05-19 16:32:13 +02:00
Sergey Sharybin 30c0c85971 Use utilities from blender::implicit_sharing 2023-05-19 09:45:25 +02:00
Sergey Sharybin d200ef9268 Fix grammar according to Hans 2023-05-19 09:23:23 +02:00
Sergey Sharybin 1520d9148f Refactor Render Result to allow implicit buffer sharing
Allows to share buffer data between the render result and image buffers.

The storage of the passes and buffers in the render result have been
wrapped into utility structures, with functions to operate on them.

Currently only image buffers which are sharing buffers with the render
results are using the implicit sharing. This allows proper decoupling of
the image buffers from the lifetime of the underlying render result.

Fixes #107248: Compositor ACCESS VIOLATION when updating datablocks from handlers

Additionally, this lowers the memory usage of multi-layer EXR sequences
by avoiding having two copies of render passes in memory.

It is possible to use implicit sharing in more places, but needs
some API to ensure the render result is the only owner of data before
writing to its pixels.
2023-05-18 13:39:38 +02:00