From 6452d9f02f07fb3aaa7c6601228ef96015a54996 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 25 Mar 2014 12:30:41 +0600 Subject: 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'. --- source/blender/imbuf/intern/moviecache.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/imbuf') 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) -- cgit v1.2.3