浏览代码

Fix build

David Catuhe 5 年之前
父节点
当前提交
d0f3529080
共有 3 个文件被更改,包括 12 次插入7 次删除
  1. 1 1
      package.json
  2. 2 2
      src/Engines/engine.ts
  3. 9 4
      src/Engines/thinEngine.ts

+ 1 - 1
package.json

@@ -107,4 +107,4 @@
         "xhr2": "^0.1.4",
         "xmlbuilder": "8.2.2"
     }
-}
+}

+ 2 - 2
src/Engines/engine.ts

@@ -1864,7 +1864,7 @@ export class Engine extends ThinEngine {
         this.bindArrayBuffer(result);
         this._gl.bufferData(this._gl.ARRAY_BUFFER, capacity, this._gl.DYNAMIC_DRAW);
         return result;
-    }    
+    }
 
     /**
      * Delete a webGL buffer used with instanciation
@@ -1872,7 +1872,7 @@ export class Engine extends ThinEngine {
      */
     public deleteInstancesBuffer(buffer: WebGLBuffer): void {
         this._gl.deleteBuffer(buffer);
-    }    
+    }
 
     /** @hidden */
     public _readTexturePixels(texture: InternalTexture, width: number, height: number, faceIndex = -1, level = 0, buffer: Nullable<ArrayBufferView> = null): ArrayBufferView {

+ 9 - 4
src/Engines/thinEngine.ts

@@ -699,6 +699,7 @@ export class ThinEngine {
             maxVertexUniformVectors: this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),
             parallelShaderCompile: this._gl.getExtension('KHR_parallel_shader_compile'),
             standardDerivatives: this._webGLVersion > 1 || (this._gl.getExtension('OES_standard_derivatives') !== null),
+            maxAnisotropy: 1,
             astc: this._gl.getExtension('WEBGL_compressed_texture_astc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_astc'),
             s3tc: this._gl.getExtension('WEBGL_compressed_texture_s3tc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc'),
             pvrtc: this._gl.getExtension('WEBGL_compressed_texture_pvrtc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),
@@ -706,7 +707,6 @@ export class ThinEngine {
             etc2: this._gl.getExtension('WEBGL_compressed_texture_etc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc') ||
                 this._gl.getExtension('WEBGL_compressed_texture_es3_0'), // also a requirement of OpenGL ES 3
             textureAnisotropicFilterExtension: this._gl.getExtension('EXT_texture_filter_anisotropic') || this._gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic') || this._gl.getExtension('MOZ_EXT_texture_filter_anisotropic'),
-            maxAnisotropy: this._caps.textureAnisotropicFilterExtension ? this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0,
             uintIndices: this._webGLVersion > 1 || this._gl.getExtension('OES_element_index_uint') !== null,
             fragmentDepthSupported: this._webGLVersion > 1 || this._gl.getExtension('EXT_frag_depth') !== null,
             highPrecisionShaderSupported: false,
@@ -716,11 +716,11 @@ export class ThinEngine {
             maxMSAASamples: 1,
             colorBufferFloat: this._webGLVersion > 1 && this._gl.getExtension('EXT_color_buffer_float'),
             textureFloat: (this._webGLVersion > 1 || this._gl.getExtension('OES_texture_float')) ? true : false,
-            textureFloatLinearFiltering: this._caps.textureFloat && this._gl.getExtension('OES_texture_float_linear') ? true : false,
-            textureFloatRender: this._caps.textureFloat && this._canRenderToFloatFramebuffer() ? true : false,
             textureHalfFloat: (this._webGLVersion > 1 || this._gl.getExtension('OES_texture_half_float')) ? true : false,
-            textureHalfFloatLinearFiltering: (this._webGLVersion > 1 || (this._caps.textureHalfFloat && this._gl.getExtension('OES_texture_half_float_linear'))) ? true : false,
             textureHalfFloatRender: false,
+            textureFloatLinearFiltering: false,
+            textureFloatRender: false,
+            textureHalfFloatLinearFiltering: false,
             vertexArrayObject: false,
             instancedArrays: false,
             textureLOD: (this._webGLVersion > 1 || this._gl.getExtension('EXT_shader_texture_lod')) ? true : false,
@@ -766,6 +766,11 @@ export class ThinEngine {
             this._caps.canUseTimestampForTimerQuery = this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT, this._caps.timerQuery.QUERY_COUNTER_BITS_EXT) > 0;
         }
 
+        this._caps.maxAnisotropy = this._caps.textureAnisotropicFilterExtension ? this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0;
+        this._caps.textureFloatLinearFiltering = this._caps.textureFloat && this._gl.getExtension('OES_texture_float_linear') ? true : false;
+        this._caps.textureFloatRender = this._caps.textureFloat && this._canRenderToFloatFramebuffer() ? true : false;
+        this._caps.textureHalfFloatLinearFiltering = (this._webGLVersion > 1 || (this._caps.textureHalfFloat && this._gl.getExtension('OES_texture_half_float_linear'))) ? true : false;
+
         // 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;