Ver Fonte

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 há 3 anos atrás
pai
commit
c40d5eb52e
1 ficheiros alterados com 1 adições e 1 exclusões
  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 --;
 					this.activeQueries --;
 
 
 
 
-				} else {
+				} else if ( ! gl.isContextLost() ) {
 
 
 					// otherwise try again the next frame
 					// otherwise try again the next frame
 					requestAnimationFrame( checkQuery );
 					requestAnimationFrame( checkQuery );