소스 검색

Remove call to checkFramebufferStatus (#23770)

This is a perf hit and AFAIK there's not much reason to do the check
except to give the user an error message that the browser itself
would print.

No other place in the code calls checkFramebufferStatus so not sure
why this is special. If the framebuffer is not complete you'd be
getting rendering warnings from the browser as well.
Greggman 3 년 전
부모
커밋
6f1caec4b6
1개의 변경된 파일3개의 추가작업 그리고 11개의 파일을 삭제
  1. 3 11
      src/renderers/WebGLRenderer.js

+ 3 - 11
src/renderers/WebGLRenderer.js

@@ -1984,19 +1984,11 @@ function WebGLRenderer( parameters = {} ) {
 
 				}
 
-				if ( _gl.checkFramebufferStatus( _gl.FRAMEBUFFER ) === _gl.FRAMEBUFFER_COMPLETE ) {
+				// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)
 
-					// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)
+				if ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {
 
-					if ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {
-
-						_gl.readPixels( x, y, width, height, utils.convert( textureFormat ), utils.convert( textureType ), buffer );
-
-					}
-
-				} else {
-
-					console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.' );
+					_gl.readPixels( x, y, width, height, utils.convert( textureFormat ), utils.convert( textureType ), buffer );
 
 				}