@@ -7,7 +7,7 @@ export class StrandsNode {
77 this . id = id ;
88 this . strandsContext = strandsContext ;
99 this . dimension = dimension ;
10-
10+
1111 // Store original identifier for varying variables
1212 const dag = this . strandsContext . dag ;
1313 const nodeData = getNodeDataFromID ( dag , this . id ) ;
@@ -24,7 +24,7 @@ export class StrandsNode {
2424 const { dag, cfg } = this . strandsContext ;
2525 const orig = getNodeDataFromID ( dag , this . id ) ;
2626 const baseType = orig ?. baseType ?? BaseType . FLOAT ;
27-
27+
2828 let newValueID ;
2929 if ( value instanceof StrandsNode ) {
3030 newValueID = value . id ;
@@ -36,7 +36,7 @@ export class StrandsNode {
3636 ) ;
3737 newValueID = newVal . id ;
3838 }
39-
39+
4040 // For varying variables, we need both assignment generation AND a way to reference by identifier
4141 if ( this . _originalIdentifier ) {
4242 // Create a variable node for the target (the varying variable)
@@ -45,7 +45,7 @@ export class StrandsNode {
4545 { baseType : this . _originalBaseType , dimension : this . _originalDimension } ,
4646 this . _originalIdentifier
4747 ) ;
48-
48+
4949 // Create assignment node for GLSL generation
5050 const assignmentNode = createNodeData ( {
5151 nodeType : NodeType . ASSIGNMENT ,
@@ -54,10 +54,10 @@ export class StrandsNode {
5454 } ) ;
5555 const assignmentID = getOrCreateNode ( dag , assignmentNode ) ;
5656 recordInBasicBlock ( cfg , cfg . currentBlock , assignmentID ) ;
57-
57+
5858 // Track for global assignments processing
5959 this . strandsContext . globalAssignments . push ( assignmentID ) ;
60-
60+
6161 // Simply update this node to be a variable node with the identifier
6262 // This ensures it always generates the variable name in expressions
6363 const variableNodeData = createNodeData ( {
@@ -67,19 +67,19 @@ export class StrandsNode {
6767 identifier : this . _originalIdentifier
6868 } ) ;
6969 const variableID = getOrCreateNode ( dag , variableNodeData ) ;
70-
70+
7171 this . id = variableID ; // Point to the variable node for expression generation
7272 } else {
7373 this . id = newValueID ; // For non-varying variables, just update to new value
7474 }
75-
75+
7676 return this ;
7777 }
7878 bridgeSwizzle ( swizzlePattern , value ) {
7979 const { dag, cfg } = this . strandsContext ;
8080 const orig = getNodeDataFromID ( dag , this . id ) ;
8181 const baseType = orig ?. baseType ?? BaseType . FLOAT ;
82-
82+
8383 let newValueID ;
8484 if ( value instanceof StrandsNode ) {
8585 newValueID = value . id ;
@@ -91,7 +91,7 @@ export class StrandsNode {
9191 ) ;
9292 newValueID = newVal . id ;
9393 }
94-
94+
9595 // For varying variables, create swizzle assignment
9696 if ( this . _originalIdentifier ) {
9797 // Create a variable node for the target with swizzle
@@ -100,7 +100,7 @@ export class StrandsNode {
100100 { baseType : this . _originalBaseType , dimension : this . _originalDimension } ,
101101 this . _originalIdentifier
102102 ) ;
103-
103+
104104 // Create a swizzle node for the target (myVarying.xyz)
105105 const swizzleNode = createNodeData ( {
106106 nodeType : NodeType . OPERATION ,
@@ -111,7 +111,7 @@ export class StrandsNode {
111111 dependsOn : [ targetVarID ]
112112 } ) ;
113113 const swizzleID = getOrCreateNode ( dag , swizzleNode ) ;
114-
114+
115115 // Create assignment node: myVarying.xyz = value
116116 const assignmentNode = createNodeData ( {
117117 nodeType : NodeType . ASSIGNMENT ,
@@ -120,10 +120,10 @@ export class StrandsNode {
120120 } ) ;
121121 const assignmentID = getOrCreateNode ( dag , assignmentNode ) ;
122122 recordInBasicBlock ( cfg , cfg . currentBlock , assignmentID ) ;
123-
123+
124124 // Track for global assignments processing in the current hook context
125125 this . strandsContext . globalAssignments . push ( assignmentID ) ;
126-
126+
127127 // Simply update this node to be a variable node with the identifier
128128 // This ensures it always generates the variable name in expressions
129129 const variableNodeData = createNodeData ( {
@@ -133,12 +133,12 @@ export class StrandsNode {
133133 identifier : this . _originalIdentifier
134134 } ) ;
135135 const variableID = getOrCreateNode ( dag , variableNodeData ) ;
136-
136+
137137 this . id = variableID ; // Point to the variable node, not the assignment node
138138 } else {
139139 this . id = newValueID ; // For non-varying variables, just update to new value
140140 }
141-
141+
142142 return this ;
143143 }
144144 getValue ( ) {
@@ -150,7 +150,7 @@ export class StrandsNode {
150150 ) ;
151151 return createStrandsNode ( id , dimension , this . strandsContext ) ;
152152 }
153-
153+
154154 return this ;
155155 }
156156}
0 commit comments