diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-01-13 16:42:40 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-01-13 16:47:15 +0400 |
commit | b1bb7d2ee06d13e95154d13a6e830b8b0f845cde (patch) | |
tree | 962aa741cbdb06dd9786d62e4641b9708efd6cc8 /source/blender/blenkernel/intern/image.c | |
parent | daedf5be8c077689af1987fd6932568d9ad64a9f (diff) |
Fix T38040: Crash after loading big image file in compositor
Issue was caused by cache limitor removing viewer image buffer
from the memory during compositing. Now made it so all viewer
images are persistent in the memory.
This solves the crash mentioned above and also makes it so
render/compo results are never lost.
Further tweaks are possible, but pretty much happy now, at
least no stoppers for work are there.
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index f83112ba283..636c08fd560 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -137,6 +137,9 @@ static void imagecache_put(Image *image, int index, ImBuf *ibuf) ImageCacheKey key; if (image->cache == NULL) { + // char cache_name[64]; + // BLI_snprintf(cache_name, sizeof(cache_name), "Image Datablock %s", image->id.name); + image->cache = IMB_moviecache_create("Image Datablock Cache", sizeof(ImageCacheKey), imagecache_hashhash, imagecache_hashcmp); } @@ -3099,6 +3102,7 @@ static ImBuf *image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r) /* always verify entirely, and potentially * returns pointer to release later */ ibuf = image_get_render_result(ima, iuser, lock_r); + ibuf->userflags |= IB_PERSISTENT; } else if (ima->type == IMA_TYPE_COMPOSITE) { /* requires lock/unlock, otherwise don't return image */ @@ -3117,6 +3121,7 @@ static ImBuf *image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r) ibuf = IMB_allocImBuf(256, 256, 32, IB_rect); image_assign_ibuf(ima, ibuf, 0, frame); } + ibuf->userflags |= IB_PERSISTENT; } } } |