Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -1572,15 +1572,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
3 changes: 2 additions & 1 deletion src/renderers/webgpu/nodes/WGSLNodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,8 @@ class WGSLNodeBuilder extends NodeBuilder {

uniformGPU = buffer;

uniformNode.name = name ? name : 'NodeBuffer_' + uniformNode.id;
const nodeName = uniformNode.name || uniformNode.id;
uniformNode.name = name ? name : ( String( nodeName ).startsWith( 'NodeBuffer_' ) ? nodeName : 'NodeBuffer_' + nodeName );

} else {

Expand Down
Loading