This patch proposes to unify the functions that rewrite the 3DView's depth buffer
(ED_view3d_backbuf_depth_validate, ED_view3d_draw_depth
and ED_view3d_draw_depth_gpencil) in a new one called
ED_view3d_depth_override.
This new function is similar to the existing ED_view3d_autodist_init
so it was now removed and replaced.
Also, since ED_view3d_depth_update depends on the render context, and
changing the context is a slow operation, that function also was removed,
and the depth buffer cached is now updated inside the new unified drawing
function when the "bool update_cache" parameter is true.
Another thing that this patch changes is the V3D_INVALID_BACKBUF flag.
It is now V3D_RUNTIME_DEPTHBUF_OVERRIDDEN and is part of runtime.flag
as it does not need to be saved in the file.
So in summary, the functions indicated below have been replaced by
parameters of the new ED_view3d_depth_override:
| ED_view3d_backbuf_depth_validate | -> enum V3D_DEPTH_OBJECT_ONLY |
| ED_view3d_draw_depth | -> enum V3D_DEPTH_NO_GPENCIL |
| ED_view3d_draw_depth_gpencil | -> enum V3D_DEPTH_GPENCIL_ONLY |
| ED_view3d_depth_update | -> bool update_cache |
The ED_view3d_autodist_init utility was be replaced and removed.
| ED_view3d_autodist_init | -> ED_view3d_depth_override |
And the V3D_INVALID_BACKBUF flag has been renamed and moved:
| V3D_INVALID_BACKBUF | -> V3D_RUNTIME_DEPTHBUF_OVERRIDDEN |