From 65f8dbf6aea1c4aee3e4d1d0b7e2bf6b753f2b79 Mon Sep 17 00:00:00 2001 From: "PSp..om" Date: Tue, 7 Feb 2012 11:04:46 +0000 Subject: [PATCH] For the cases where a define has not actually changed, don't reload the shader. This prevents a lot of extra work from being done. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9139 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/material/Technique.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/engine/src/core/com/jme3/material/Technique.java b/engine/src/core/com/jme3/material/Technique.java index b4ce59aaf..5ae20a50e 100644 --- a/engine/src/core/com/jme3/material/Technique.java +++ b/engine/src/core/com/jme3/material/Technique.java @@ -114,8 +114,7 @@ public class Technique implements Savable { void notifySetParam(String paramName, VarType type, Object value) { String defineName = def.getShaderParamDefine(paramName); if (defineName != null) { - defines.set(defineName, type, value); - needReload = true; + needReload = defines.set(defineName, type, value); } if (shader != null) { updateUniformParam(paramName, type, value); @@ -128,8 +127,7 @@ public class Technique implements Savable { void notifyClearParam(String paramName) { String defineName = def.getShaderParamDefine(paramName); if (defineName != null) { - defines.remove(defineName); - needReload = true; + needReload = defines.remove(defineName); } if (shader != null) { if (!paramName.startsWith("m_")) {