From b50839038d6b3d20e52896cadff5076b94cf3705 Mon Sep 17 00:00:00 2001 From: Luca Rood Date: Mon, 26 Jun 2017 17:53:47 +0200 Subject: [PATCH] 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... --- source/blender/editors/render/render_update.c | 5 ----- 1 file changed, 5 deletions(-) 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); }