소스 검색

WebGPURenderer: Avoid object creation in PassNode.updateBefore (#28505)

Co-authored-by: aardgoose <[email protected]>
aardgoose 1 년 전
부모
커밋
a3c4bc086b
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      examples/jsm/nodes/display/PassNode.js

+ 3 - 1
examples/jsm/nodes/display/PassNode.js

@@ -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 ) {
@@ -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 );