diff options
author | Richard Antalik <richardantalik@gmail.com> | 2020-02-17 18:02:36 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2020-02-17 18:46:59 +0300 |
commit | 18b693bdbd6bac7c381e46aa4b95c3e81494855e (patch) | |
tree | 39cc97748b093ba57afeef989fb44edb391fbbbf /source/blender/blenkernel | |
parent | 20a4cdfd700d3722fdcaa3b3952ccea1b0e6ee47 (diff) |
Fix T70229: Show Cache On will cause a lower fps
Use gpu batch drawing for cache content in VSE.
Immediate drawing caused significant dorp in framerate.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D6835
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/seqcache.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 2618bea74e6..0057d6d8515 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -338,6 +338,7 @@ void BKE_sequencer_cache_iterate( struct Scene *scene, void *userdata, bool callback(void *userdata, struct Sequence *seq, int cfra, int cache_type, float cost)); +size_t BKE_sequencer_cache_get_num_items(struct Scene *scene); bool BKE_sequencer_cache_is_full(struct Scene *scene); /* ********************************************************************** diff --git a/source/blender/blenkernel/intern/seqcache.c b/source/blender/blenkernel/intern/seqcache.c index ccb1869ee21..0846c6c90a6 100644 --- a/source/blender/blenkernel/intern/seqcache.c +++ b/source/blender/blenkernel/intern/seqcache.c @@ -717,6 +717,20 @@ void BKE_sequencer_cache_put( seq_cache_unlock(scene); } +size_t BKE_sequencer_cache_get_num_items(struct Scene *scene) +{ + SeqCache *cache = seq_cache_get_from_scene(scene); + if (!cache) { + return 0; + } + + seq_cache_lock(scene); + size_t num_items = BLI_ghash_len(cache->hash); + seq_cache_unlock(scene); + + return num_items; +} + void BKE_sequencer_cache_iterate( struct Scene *scene, void *userdata, |