Browse Source

Firefox doesn't have this extension apparently.

Simon 2 years ago
parent
commit
14874ccc74
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/base/threejs-component.js

+ 1 - 1
src/base/threejs-component.js

@@ -441,7 +441,7 @@ export const threejs_component = (() => {
 
 
       const gl = this.#threejs_.getContext();
       const gl = this.#threejs_.getContext();
       const ext = gl.getExtension('EXT_disjoint_timer_query_webgl2');
       const ext = gl.getExtension('EXT_disjoint_timer_query_webgl2');
-      if (this.timerQuery === null) {
+      if (this.timerQuery === null && ext !== null) {
         this.timerQuery = gl.createQuery();
         this.timerQuery = gl.createQuery();
         gl.beginQuery(ext.TIME_ELAPSED_EXT, this.timerQuery);
         gl.beginQuery(ext.TIME_ELAPSED_EXT, this.timerQuery);
       }
       }