[Bf-blender-cvs] [b50839038d6] blender2.8: Stop object shaders from being updated when changing lamp properties

Luca Rood noreply at git.blender.org
Mon Jun 26 18:01:29 CEST 2017


Commit: b50839038d6b3d20e52896cadff5076b94cf3705
Author: Luca Rood
Date:   Mon Jun 26 17:53:47 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBb50839038d6b3d20e52896cadff5076b94cf3705

Stop object shaders from being updated when changing lamp properties

Object shaders no longer depend on lamp data at compile time, thus they
don't need to be invalidated when lamps change. Disabling shader
recompilation allows fast viewport updates when changing lamp settings.

Note that even though shaders for lamps are currently not being used,
`lamp_changed` is still freeing the lamp shaders, as at some point we
might want to use shaders for lamps...

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

M	source/blender/editors/render/render_update.c

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

diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c
index b8f64c1db58..badcfee0533 100644
--- a/source/blender/editors/render/render_update.c
+++ b/source/blender/editors/render/render_update.c
@@ -348,7 +348,6 @@ static void material_changed(Main *bmain, Material *ma)
 static void lamp_changed(Main *bmain, Lamp *la)
 {
 	Object *ob;
-	Material *ma;
 
 	/* icons */
 	BKE_icon_changed(BKE_icon_id_ensure(&la->id));
@@ -358,10 +357,6 @@ static void lamp_changed(Main *bmain, Lamp *la)
 		if (ob->data == la && ob->gpulamp.first)
 			GPU_lamp_free(ob);
 
-	for (ma = bmain->mat.first; ma; ma = ma->id.next)
-		if (ma->gpumaterial.first)
-			GPU_material_free(&ma->gpumaterial);
-
 	if (defmaterial.gpumaterial.first)
 		GPU_material_free(&defmaterial.gpumaterial);
 }




More information about the Bf-blender-cvs mailing list