瀏覽代碼

WebGPURenderer: cleanup (#27090)

* cleanup

* cleanup
sunag 1 年之前
父節點
當前提交
2a50f4b1a4

+ 3 - 5
examples/jsm/nodes/core/NodeBuilder.js

@@ -641,17 +641,15 @@ class NodeBuilder {
 
 
 	}
 	}
 
 
-	getStructTypeFromNode( node, shaderStage = this.shaderStage, name = null ) {
+	getStructTypeFromNode( node, shaderStage = this.shaderStage ) {
 
 
 		const nodeData = this.getDataFromNode( node, shaderStage );
 		const nodeData = this.getDataFromNode( node, shaderStage );
 
 
-		let nodeStruct = nodeData.structType;
-
-		if ( nodeStruct === undefined ) {
+		if ( nodeData.structType === undefined ) {
 
 
 			const index = this.structs.index ++;
 			const index = this.structs.index ++;
 
 
-			node.name = `StructType${index}`;
+			node.name = `StructType${ index }`;
 			this.structs[ shaderStage ].push( node );
 			this.structs[ shaderStage ].push( node );
 
 
 			nodeData.structType = node;
 			nodeData.structType = node;

+ 3 - 3
examples/jsm/nodes/core/OutputStructNode.js

@@ -20,7 +20,7 @@ class OutputStructNode extends Node {
 		const members = this.members;
 		const members = this.members;
 		const types = [];
 		const types = [];
 
 
-		for ( let i = 0; i < members.length; i++ ) {
+		for ( let i = 0; i < members.length; i ++ ) {
 
 
 			types.push( members[ i ].getNodeType( builder ) );
 			types.push( members[ i ].getNodeType( builder ) );
 
 
@@ -41,11 +41,11 @@ class OutputStructNode extends Node {
 
 
 		const structPrefix = propertyName !== '' ? propertyName + '.' : '';
 		const structPrefix = propertyName !== '' ? propertyName + '.' : '';
 
 
-		for ( let i = 0; i < members.length; i++ ) {
+		for ( let i = 0; i < members.length; i ++ ) {
 
 
 			const snippet = members[ i ].build( builder, output );
 			const snippet = members[ i ].build( builder, output );
 
 
-			builder.addLineFlowCode( `${structPrefix}m${i} = ${snippet}` );
+			builder.addLineFlowCode( `${ structPrefix }m${ i } = ${ snippet }` );
 
 
 		}
 		}
 
 

+ 4 - 4
examples/jsm/nodes/core/StructTypeNode.js

@@ -6,16 +6,16 @@ class StructTypeNode extends Node {
 
 
 		super();
 		super();
 
 
-        this.types = types;
+		this.types = types;
 		this.isStructTypeNode = true;
 		this.isStructTypeNode = true;
 
 
 	}
 	}
 
 
-    getMemberTypes() {
+	getMemberTypes() {
 
 
-        return this.types;
+		return this.types;
 
 
-    }
+	}
 
 
 }
 }
 
 

+ 4 - 2
examples/jsm/renderers/webgl/WebGLBackend.js

@@ -190,7 +190,7 @@ class WebGLBackend extends Backend {
 
 
 				}
 				}
 
 
-			}
+			};
 
 
 			check();
 			check();
 
 
@@ -247,6 +247,7 @@ class WebGLBackend extends Backend {
 						gl.clearBufferfv( gl.COLOR, i, [ clearColor.r, clearColor.g, clearColor.b, clearColor.a ] );
 						gl.clearBufferfv( gl.COLOR, i, [ clearColor.r, clearColor.g, clearColor.b, clearColor.a ] );
 
 
 					}
 					}
+
 				}
 				}
 
 
 				if ( depth && stencil ) {
 				if ( depth && stencil ) {
@@ -260,6 +261,7 @@ class WebGLBackend extends Backend {
 				} else if ( stencil ) {
 				} else if ( stencil ) {
 
 
 					gl.clearBufferiv( gl.STENCIL, 0, [ 0 ] );
 					gl.clearBufferiv( gl.STENCIL, 0, [ 0 ] );
+
 				}
 				}
 
 
 			}
 			}
@@ -899,7 +901,7 @@ class WebGLBackend extends Backend {
 
 
 				const drawBuffers = [];
 				const drawBuffers = [];
 
 
-				for ( let i = 0; i < textures.length; i++ ) {
+				for ( let i = 0; i < textures.length; i ++ ) {
 
 
 					const texture = textures[ i ];
 					const texture = textures[ i ];
 					const { textureGPU } = this.get( texture );
 					const { textureGPU } = this.get( texture );