Currently render passes in the draw manager (eevee) must be predefined
in the render result. This patch would ask the render engine for the
render passes it needs, and create these as a preparation step during
rendering. This allows any draw engine to define more complex render
passes setup.
Render passes can only be added before the call to RE_engine_begin_result.
RE_engine_begin_result makes a full copy of the render passes. During
rendering the render engines renders to the duplicated passes.
RE_engine_end_result syncs the data back to the original render passes,
but only if the passes existed in the original render result.
Currently we work-around this issue by registering the passes in
render_result_new. This is legacy blender internal structure and should
be avoided.
With upcoming projects (AOV/Cryptomatte) it becomes a bit of a mess as we
are extending legacy code to support new features. This patch allows us to
let each draw engine register their own render passes at render time
(similar to cycles and other render engines). In the future we could get
rid of all the render passes registration in render_result_new.