uniform location caching
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
4a23339807
commit
69429d70a4
@ -1,3 +1,3 @@
|
|||||||
#maven.buildNumber.plugin properties file
|
#maven.buildNumber.plugin properties file
|
||||||
#Thu May 22 18:46:40 EDT 2025
|
#Thu May 22 21:10:50 EDT 2025
|
||||||
buildNumber=630
|
buildNumber=632
|
||||||
|
|||||||
@ -45,6 +45,11 @@ public class VisualShader implements Shader {
|
|||||||
* Map of uniform name -> data about the uniform
|
* Map of uniform name -> data about the uniform
|
||||||
*/
|
*/
|
||||||
private Map<String,ShaderUniform> uniformNameMap = new HashMap<String,ShaderUniform>();
|
private Map<String,ShaderUniform> uniformNameMap = new HashMap<String,ShaderUniform>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map of uniform name -> location of uniform
|
||||||
|
*/
|
||||||
|
public Map<String,Integer> uniformNameLocMap = new HashMap<String,Integer>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The map of uniform location -> current value of uniform
|
* The map of uniform location -> current value of uniform
|
||||||
@ -369,7 +374,11 @@ public class VisualShader implements Shader {
|
|||||||
}
|
}
|
||||||
return uniform.getLocation();
|
return uniform.getLocation();
|
||||||
}
|
}
|
||||||
|
if(this.uniformNameLocMap.containsKey(uniformName)){
|
||||||
|
return uniformNameLocMap.get(uniformName);
|
||||||
|
}
|
||||||
int rVal = GL40.glGetUniformLocation(this.getId(), uniformName);
|
int rVal = GL40.glGetUniformLocation(this.getId(), uniformName);
|
||||||
|
uniformNameLocMap.put(uniformName,rVal);
|
||||||
if(Globals.renderingEngine.checkError()){
|
if(Globals.renderingEngine.checkError()){
|
||||||
LoggerInterface.loggerRenderer.WARNING("Uniform failed with shader id " + this.getId());
|
LoggerInterface.loggerRenderer.WARNING("Uniform failed with shader id " + this.getId());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user