瀏覽代碼

GPUStatsPanel: Prevent infinite loop when webgl context is lost (#23990)

* Prevent infinite loop when webgl context is lost

* Update GPUStatsPanel.js

Co-authored-by: Michael Herzog <[email protected]>
William McMurray 3 年之前
父節點
當前提交
c40d5eb52e
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      examples/jsm/utils/GPUStatsPanel.js

+ 1 - 1
examples/jsm/utils/GPUStatsPanel.js

@@ -86,7 +86,7 @@ export class GPUStatsPanel extends Stats.Panel {
 					this.activeQueries --;
 
 
-				} else {
+				} else if ( ! gl.isContextLost() ) {
 
 					// otherwise try again the next frame
 					requestAnimationFrame( checkQuery );