From 223f7e79f9fa221f60841afcff9a9ed8a97d9306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 19 Apr 2019 02:22:22 +0200 Subject: 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/intern/draw_cache_impl.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/draw/intern/draw_cache_impl.h') diff --git a/source/blender/draw/intern/draw_cache_impl.h b/source/blender/draw/intern/draw_cache_impl.h index 94d8a82f2e4..e4ce3ed9d49 100644 --- a/source/blender/draw/intern/draw_cache_impl.h +++ b/source/blender/draw/intern/draw_cache_impl.h @@ -61,6 +61,11 @@ void DRW_particle_batch_cache_free(struct ParticleSystem *psys); void DRW_gpencil_batch_cache_dirty_tag(struct bGPdata *gpd); void DRW_gpencil_batch_cache_free(struct bGPdata *gpd); +/* Garbage collection */ +void DRW_batch_cache_free_old(struct Object *ob, int ctime); + +void DRW_mesh_batch_cache_free_old(struct Mesh *me, int ctime); + /* Curve */ void DRW_curve_batch_cache_create_requested(struct Object *ob); -- cgit v1.2.3