DRW: Add batch garbage collection
authorClément Foucault <foucault.clem@gmail.com>
Fri, 19 Apr 2019 00:22:22 +0000 (02:22 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Fri, 19 Apr 2019 13:19:43 +0000 (15:19 +0200)
commit223f7e79f9fa221f60841afcff9a9ed8a97d9306
treec39a9af28d6f8ad4cc386972e2f67677224d6b7a
parent973e64cf9cb23b91e329ebac9a0f4c69647edf20
DRW: Add batch garbage collection

This is only working for shading batches for the moment and only if some Custom data layer are not needed anymore.

The collection rate is hardcoded at 60 sec but could be exposed to the user.

This system can be extended and discard most unused batches in the future.

This commit is in prevision of removing BKE_MESH_BATCH_DIRTY_SHADING when changing shader parameters.
source/blender/draw/DRW_engine.h
source/blender/draw/intern/draw_cache.c
source/blender/draw/intern/draw_cache_impl.h
source/blender/draw/intern/draw_cache_impl_mesh.c
source/blender/draw/intern/draw_manager.c
source/blender/editors/space_view3d/view3d_draw.c