Skip to content

Commit

Permalink
WebGPURenderer: Avoid object creation in PassNode.updateBefore (mrdoo…
Browse files Browse the repository at this point in the history
…b#28505)

Co-authored-by: aardgoose <angus.sawyer@email.com>
  • Loading branch information
aardgoose and aardgoose authored May 27, 2024
1 parent b609f8a commit a3c4bc0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/jsm/nodes/display/PassNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { uniform } from '../core/UniformNode.js';
import { viewZToOrthographicDepth, perspectiveDepthToViewZ } from './ViewportDepthNode.js';
import { RenderTarget, Vector2, HalfFloatType, DepthTexture, NoToneMapping/*, FloatType*/ } from 'three';

const _size = new Vector2();

class PassTextureNode extends TextureNode {

constructor( passNode, texture ) {
Expand Down Expand Up @@ -135,7 +137,7 @@ class PassNode extends TempNode {

this._pixelRatio = renderer.getPixelRatio();

const size = renderer.getSize( new Vector2() );
const size = renderer.getSize( _size );

this.setSize( size.width, size.height );

Expand Down

0 comments on commit a3c4bc0

Please sign in to comment.