Fixed NPE and ConcurrentModificationException during cloning TechniqueDef.
This commit is contained in:
parent
32b947a0ac
commit
94f542912b
@ -190,7 +190,13 @@ public class ShaderGenerationInfo implements Savable, Cloneable {
|
||||
|
||||
@Override
|
||||
protected ShaderGenerationInfo clone() throws CloneNotSupportedException {
|
||||
ShaderGenerationInfo clone = (ShaderGenerationInfo) super.clone();
|
||||
final ShaderGenerationInfo clone = (ShaderGenerationInfo) super.clone();
|
||||
clone.attributes = new ArrayList<>();
|
||||
clone.vertexUniforms = new ArrayList<>();
|
||||
clone.fragmentUniforms = new ArrayList<>();
|
||||
clone.fragmentGlobals = new ArrayList<>();
|
||||
clone.unusedNodes = new ArrayList<>();
|
||||
|
||||
|
||||
for (ShaderNodeVariable attribute : attributes) {
|
||||
clone.attributes.add(attribute.clone());
|
||||
|
@ -801,6 +801,7 @@ public class TechniqueDef implements Savable, Cloneable {
|
||||
clone.paramToDefineId.putAll(paramToDefineId);
|
||||
|
||||
if (shaderNodes != null) {
|
||||
clone.shaderNodes = new ArrayList<>();
|
||||
for (ShaderNode shaderNode : shaderNodes) {
|
||||
clone.shaderNodes.add(shaderNode.clone());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user