[Bf-blender-cvs] [98c8b5a6fbd] blender2.8: No need to free all the shaders when appending or reloading libraries

Dalai Felinto noreply at git.blender.org
Thu Jun 29 19:14:56 CEST 2017


Commit: 98c8b5a6fbdc47eb13d3d2d19457135ef54774cd
Author: Dalai Felinto
Date:   Thu Jun 29 19:05:26 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB98c8b5a6fbdc47eb13d3d2d19457135ef54774cd

No need to free all the shaders when appending or reloading libraries

To recompile all the shaders is expensive. And something to be avoided at all costs.

It was needed before because for every new lamp in the file we needed to
recompile the shaders. Now this is no longer required since we are using
UBOs for the sahders.

===================================================================

M	source/blender/windowmanager/intern/wm_files_link.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index ff37765b683..af0d2be8097 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -504,9 +504,6 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
 
 	/* recreate dependency graph to include new objects */
 	DEG_scene_relations_rebuild(bmain, scene);
-	
-	/* free gpu materials, some materials depend on existing objects, such as lamps so freeing correctly refreshes */
-	GPU_materials_free();
 
 	/* XXX TODO: align G.lib with other directory storage (like last opened image etc...) */
 	BLI_strncpy(G.lib, root, FILE_MAX);
@@ -802,9 +799,6 @@ static void lib_relocate_do(
 
 	/* recreate dependency graph to include new objects */
 	DEG_scene_relations_rebuild(bmain, scene);
-
-	/* free gpu materials, some materials depend on existing objects, such as lamps so freeing correctly refreshes */
-	GPU_materials_free();
 }
 
 void WM_lib_reload(Library *lib, bContext *C, ReportList *reports)




More information about the Bf-blender-cvs mailing list