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.
This commit is contained in:
2019-04-19 02:22:22 +02:00
parent 973e64cf9c
commit 223f7e79f9
6 changed files with 95 additions and 3 deletions

View File

@@ -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);