瀏覽代碼

Merge pull request #8301 from sebavan/master

Strict types assignments
sebavan 5 年之前
父節點
當前提交
aa25febe40
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/Engines/thinEngine.ts

+ 6 - 2
src/Engines/thinEngine.ts

@@ -788,7 +788,9 @@ export class ThinEngine {
         }
 
         // Constants
-        this._gl.HALF_FLOAT_OES = 0x8D61;   // Half floating-point type (16-bit).
+        if (this._gl.HALF_FLOAT_OES !== 0x8D61) {
+            this._gl.HALF_FLOAT_OES = 0x8D61;   // Half floating-point type (16-bit).
+        }
         if (this._gl.RGBA16F !== 0x881A) {
             this._gl.RGBA16F = 0x881A;      // RGBA 16-bit floating-point color-renderable internal sized format.
         }
@@ -814,7 +816,9 @@ export class ThinEngine {
 
         // Checks if some of the format renders first to allow the use of webgl inspector.
         if (this._webGLVersion > 1) {
-            this._gl.HALF_FLOAT_OES = 0x140B;
+            if (this._gl.HALF_FLOAT_OES !== 0x140B) {
+                this._gl.HALF_FLOAT_OES = 0x140B;
+            }
         }
         this._caps.textureHalfFloatRender = this._caps.textureHalfFloat && this._canRenderToHalfFloatFramebuffer();
         // Draw buffers