* Fix crash on context.restart(). Reset shader sources when shader itself is reset

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8166 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..rd 13 years ago
parent 8411ff22e2
commit 471f449017
  1. 11
      engine/src/core/com/jme3/shader/Shader.java

@ -206,11 +206,11 @@ public final class Shader extends GLObject implements Savable {
} }
public void deleteObject(Renderer r){ public void deleteObject(Renderer r){
r.deleteShaderSource(this); r.deleteShaderSource(ShaderSource.this);
} }
public GLObject createDestructableClone(){ public GLObject createDestructableClone(){
return new ShaderSource(this); return new ShaderSource(ShaderSource.this);
} }
} }
@ -427,9 +427,12 @@ public final class Shader extends GLObject implements Savable {
public void resetObject() { public void resetObject() {
this.id = -1; this.id = -1;
this.usable = false; this.usable = false;
for (ShaderSource source : shaderList){
source.resetObject();
}
setUpdateNeeded(); setUpdateNeeded();
// Already done by the call above
//resetLocations();
} }
@Override @Override

Loading…
Cancel
Save