2028bc8d7d
This patch introduces a new Derived Resources concept to the compositor. Derived resources are resources that are computed from a particular result and cached in it in case it is needed by another operation, which can greatly improve performance in some cases at the cost of more memory usage. The first use case is to store denoised versions of the Denoising Albedo and Denoising Normals passes if auxiliary pass denoising is enabled in the denoise node. Consequently, multi-pass denoising setups where the same auxiliary passes are used in multiple denoise nodes should be much faster due to caching of the derived resources. This implementation has the limitation that it can't preemptively invalidate the cache when the derived resources are no longer needed to free up memory. This requires a special resource tracking mechanism that need to happen during node tree compilation, and will be submitted later. The limitation is not significant in the particular derived resources that is currently implemented. Since the auxiliary passes are rarely used outside of denoising. Fixes #131171. Pull Request: https://projects.blender.org/blender/blender/pulls/125671