diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-03-25 10:30:41 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-03-25 10:30:41 +0400 |
commit | 6452d9f02f07fb3aaa7c6601228ef96015a54996 (patch) | |
tree | 169140e9963fecf24f9d4e8b2ab2e9ebb5e8d026 /source/blender/imbuf/intern | |
parent | bd57ec686c7ec00a9a01e30f32bbcfd3c21a41fb (diff) |
Fix T39395: Switching to "Textured solid" and "GLSL" view will cause the FPS drop to 0
Issue was caused by the cache limitor which was removing 4k textures from the
memory when accessing other images.
This is pretty much awful situation and solved by making it so only image sequences
and movies ace cache-guarded.
Could be optimized further so images used by viewport are not being freed, but
that's much more tricky to do..
This is a nice candidature for 'a'.
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/moviecache.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/moviecache.c b/source/blender/imbuf/intern/moviecache.c index 07ce3c39d73..f699afd3475 100644 --- a/source/blender/imbuf/intern/moviecache.c +++ b/source/blender/imbuf/intern/moviecache.c @@ -200,6 +200,18 @@ static size_t IMB_get_size_in_memory(ImBuf *ibuf) int a; size_t size = 0, channel_size = 0; + /* Persistent images should have no affect on how "normal" + * images are cached. + * + * This is a bit arbitrary, but would make it so only movies + * and sequences are memory limited, keeping textures in the + * memory in order to avoid constant file reload on viewport + * update. + */ + if (ibuf->userflags & IB_PERSISTENT) { + return 0; + } + size += sizeof(ImBuf); if (ibuf->rect) |