Commit: a42638d265bbcd052dc61acc9fb403fc3d38c505
Author: Sergey Sharybin
Date: Tue Dec 2 14:50:36 2014 +0500
Branches: master
https://developer.blender.org/rBa42638d265bbcd052dc61acc9fb403fc3d38c505
No need to free GPU images from BKE_image_free_buffers when in background mode
OpenGL in background mode is not used, so we can skip mutex lock and filling in
the list which later is never used.
This gives unmeasurable speedup by skipping mutex lock, plus solves memory leak
in the background mode.
===================================================================
M source/blender/blenkernel/intern/image.c
===================================================================
diff --git a/source/blender/blenkernel/intern/image.c
b/source/blender/blenkernel/intern/image.c
index 5c4ebea..36cd7e6 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -273,7 +273,13 @@ void BKE_image_free_buffers(Image *ima)
ima->rr = NULL;
}
- GPU_free_image(ima);
+ if (!G.background) {
+ /* Background mode doesn't use opnegl,
+ * so we can avoid freeing GPU images and save some
+ * time by skipping mutex lock.
+ */
+ GPU_free_image(ima);
+ }
ima->ok = IMA_OK;
}
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs