Skip to content

Commit

Permalink
WebGPURenderer: cleanup (mrdoob#27090)
Browse files Browse the repository at this point in the history
* cleanup

* cleanup
  • Loading branch information
sunag authored Oct 30, 2023
1 parent 2e54568 commit 2a50f4b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 3 additions & 5 deletions examples/jsm/nodes/core/NodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions examples/jsm/nodes/core/OutputStructNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );

Expand All @@ -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 }` );

}

Expand Down
8 changes: 4 additions & 4 deletions examples/jsm/nodes/core/StructTypeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
}

}

Expand Down
6 changes: 4 additions & 2 deletions examples/jsm/renderers/webgl/WebGLBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class WebGLBackend extends Backend {

}

}
};

check();

Expand Down Expand Up @@ -247,6 +247,7 @@ class WebGLBackend extends Backend {
gl.clearBufferfv( gl.COLOR, i, [ clearColor.r, clearColor.g, clearColor.b, clearColor.a ] );

}

}

if ( depth && stencil ) {
Expand All @@ -260,6 +261,7 @@ class WebGLBackend extends Backend {
} else if ( stencil ) {

gl.clearBufferiv( gl.STENCIL, 0, [ 0 ] );

}

}
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 2a50f4b

Please sign in to comment.