|
|
@@ -56,17 +56,42 @@ class JoinNode extends TempNode {
|
|
|
generate( builder, output ) {
|
|
|
|
|
|
const type = this.getNodeType( builder );
|
|
|
+ const maxLength = builder.getTypeLength( type );
|
|
|
+
|
|
|
const nodes = this.nodes;
|
|
|
|
|
|
const primitiveType = builder.getComponentType( type );
|
|
|
|
|
|
const snippetValues = [];
|
|
|
|
|
|
+ let length = 0;
|
|
|
+
|
|
|
for ( const input of nodes ) {
|
|
|
|
|
|
- let inputSnippet = input.build( builder );
|
|
|
+ if ( length >= maxLength ) {
|
|
|
+
|
|
|
+ console.error( 'THREE.TSL: Length of parameters exceeds maximum length of function type.' );
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ let inputType = input.getNodeType( builder );
|
|
|
+ let inputTypeLength = builder.getTypeLength( inputType );
|
|
|
+ let inputSnippet;
|
|
|
+
|
|
|
+ if ( length + inputTypeLength > maxLength ) {
|
|
|
+
|
|
|
+ console.error( 'THREE.TSL: Length of joined data exceeds maximum length of output type.' );
|
|
|
+
|
|
|
+ inputTypeLength = maxLength - length;
|
|
|
+ inputType = builder.getTypeFromLength( inputTypeLength );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ length += inputTypeLength;
|
|
|
+ inputSnippet = input.build( builder, inputType );
|
|
|
|
|
|
- const inputPrimitiveType = builder.getComponentType( input.getNodeType( builder ) );
|
|
|
+ const inputPrimitiveType = builder.getComponentType( inputType );
|
|
|
|
|
|
if ( inputPrimitiveType !== primitiveType ) {
|
|
|
|