From 2a50f4b1a4eaa1ec43d1907f5d8c34025cd1cb0e Mon Sep 17 00:00:00 2001 From: sunag Date: Mon, 30 Oct 2023 02:52:43 -0300 Subject: [PATCH] WebGPURenderer: cleanup (#27090) * cleanup * cleanup --- examples/jsm/nodes/core/NodeBuilder.js | 8 +++----- examples/jsm/nodes/core/OutputStructNode.js | 6 +++--- examples/jsm/nodes/core/StructTypeNode.js | 8 ++++---- examples/jsm/renderers/webgl/WebGLBackend.js | 6 ++++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/jsm/nodes/core/NodeBuilder.js b/examples/jsm/nodes/core/NodeBuilder.js index 5d4217257655ad..6c9e495ad2ff75 100644 --- a/examples/jsm/nodes/core/NodeBuilder.js +++ b/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 ); - let nodeStruct = nodeData.structType; - - if ( nodeStruct === undefined ) { + if ( nodeData.structType === undefined ) { const index = this.structs.index ++; - node.name = `StructType${index}`; + node.name = `StructType${ index }`; this.structs[ shaderStage ].push( node ); nodeData.structType = node; diff --git a/examples/jsm/nodes/core/OutputStructNode.js b/examples/jsm/nodes/core/OutputStructNode.js index c63050fb1135e2..97ae4da8b6109b 100644 --- a/examples/jsm/nodes/core/OutputStructNode.js +++ b/examples/jsm/nodes/core/OutputStructNode.js @@ -20,7 +20,7 @@ class OutputStructNode extends Node { const members = this.members; const types = []; - for ( let i = 0; i < members.length; i++ ) { + for ( let i = 0; i < members.length; i ++ ) { types.push( members[ i ].getNodeType( builder ) ); @@ -41,11 +41,11 @@ class OutputStructNode extends Node { 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 ); - builder.addLineFlowCode( `${structPrefix}m${i} = ${snippet}` ); + builder.addLineFlowCode( `${ structPrefix }m${ i } = ${ snippet }` ); } diff --git a/examples/jsm/nodes/core/StructTypeNode.js b/examples/jsm/nodes/core/StructTypeNode.js index b87abb3469bd5c..3f60a853e4b394 100644 --- a/examples/jsm/nodes/core/StructTypeNode.js +++ b/examples/jsm/nodes/core/StructTypeNode.js @@ -6,16 +6,16 @@ class StructTypeNode extends Node { super(); - this.types = types; + this.types = types; this.isStructTypeNode = true; } - getMemberTypes() { + getMemberTypes() { - return this.types; + return this.types; - } + } } diff --git a/examples/jsm/renderers/webgl/WebGLBackend.js b/examples/jsm/renderers/webgl/WebGLBackend.js index 3b9842b5eaf7a2..20f9732277c9fc 100644 --- a/examples/jsm/renderers/webgl/WebGLBackend.js +++ b/examples/jsm/renderers/webgl/WebGLBackend.js @@ -190,7 +190,7 @@ class WebGLBackend extends Backend { } - } + }; check(); @@ -247,6 +247,7 @@ class WebGLBackend extends Backend { gl.clearBufferfv( gl.COLOR, i, [ clearColor.r, clearColor.g, clearColor.b, clearColor.a ] ); } + } if ( depth && stencil ) { @@ -260,6 +261,7 @@ class WebGLBackend extends Backend { } else if ( stencil ) { gl.clearBufferiv( gl.STENCIL, 0, [ 0 ] ); + } } @@ -899,7 +901,7 @@ class WebGLBackend extends Backend { const drawBuffers = []; - for ( let i = 0; i < textures.length; i++ ) { + for ( let i = 0; i < textures.length; i ++ ) { const texture = textures[ i ]; const { textureGPU } = this.get( texture );