Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/nodes/accessors/ReferenceNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class ReferenceNode extends Node {
* @type {?string}
* @default null
*/
this.name = null;
this.name = 'ref_' + this.properties.join( '_' );
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this.properties is an array containing objects or other non-primitive values, join('_') will produce non-deterministic names (e.g., '[object Object]'). Consider sanitizing the properties or using a stable serialization method to ensure deterministic naming.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

@querielo querielo Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

		/**
		 * The property name might have dots so nested properties can be referred.
		 * The hierarchy of the names is stored inside this array.
		 *
		 * @type {Array<string>}
		 */
		this.properties = property.split( '.' );

this.properties has to be Array<string>


/**
* Overwritten since reference nodes are updated per object.
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1596,15 +1596,15 @@ void main() {

} else if ( type === 'buffer' ) {

uniformNode.name = `buffer${ node.id }`;
uniformNode.name = `buffer${ node.name || node.id }`;

const sharedData = this.getSharedDataFromNode( node );

let buffer = sharedData.buffer;

if ( buffer === undefined ) {

node.name = `NodeBuffer_${ node.id }`;
node.name = `NodeBuffer_${ node.name || node.id }`;

buffer = new NodeUniformBuffer( node, group );
buffer.name = node.name;
Expand Down
16 changes: 15 additions & 1 deletion src/renderers/webgpu/nodes/WGSLNodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,21 @@ class WGSLNodeBuilder extends NodeBuilder {

uniformGPU = buffer;

uniformNode.name = name ? name : 'NodeBuffer_' + uniformNode.id;
const nodeName = uniformNode.name || uniformNode.id;

if ( name ) {

uniformNode.name = name;

} else if ( String( nodeName ).startsWith( 'NodeBuffer_' ) ) {

uniformNode.name = nodeName;

} else {

uniformNode.name = 'NodeBuffer_' + nodeName;

}

} else {

Expand Down
Loading