getVarFromNode method
dynamic
getVarFromNode(
- dynamic node,
- dynamic type, [
- dynamic shaderStage
Implementation
getVarFromNode(node, type, [shaderStage]) {
shaderStage ??= this.shaderStage;
Map nodeData = this.getDataFromNode(node, shaderStage);
var nodeVar = nodeData["variable"];
if (nodeVar == undefined) {
var vars = this.vars[shaderStage];
var index = vars.length;
nodeVar = new NodeVar('nodeVar${index}', type);
vars.add(nodeVar);
nodeData["variable"] = nodeVar;
}
return nodeVar;
}