Explorar el Código

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

PSp..om hace 14 años
padre
commit
65f8dbf6ae
Se han modificado 1 ficheros con 2 adiciones y 4 borrados
  1. 2 4
      engine/src/core/com/jme3/material/Technique.java

+ 2 - 4
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_")) {