فهرست منبع

TSL: Fix `mod()` negative values (#30796)

sunag 1 سال پیش
والد
کامیت
1ff22688cb
1فایلهای تغییر یافته به همراه3 افزوده شده و 5 حذف شده
  1. 3 5
      src/nodes/math/OperatorNode.js

+ 3 - 5
src/nodes/math/OperatorNode.js

@@ -359,15 +359,13 @@ class OperatorNode extends TempNode {
 
 
 			} else if ( op === '%' ) {
 			} else if ( op === '%' ) {
 
 
-				if ( isGLSL && builder.isInteger( typeB ) === false ) {
+				if ( builder.isInteger( typeB ) ) {
 
 
-					return builder.format( `${ builder.getMethod( 'mod', output ) }( ${ a }, ${ b } )`, type, output );
+					return builder.format( `( ${ a } % ${ b } )`, type, output );
 
 
 				} else {
 				} else {
 
 
-					// WGSL
-
-					return builder.format( `( ${ a } % ${ b } )`, type, output );
+					return builder.format( `${ builder.getMethod( 'mod', output ) }( ${ a }, ${ b } )`, type, output );
 
 
 				}
 				}
 
 

粤ICP备19079148号