diff --git a/src/gl/context.js b/src/gl/context.js index 76d20e5b2cb..1d148e404e9 100644 --- a/src/gl/context.js +++ b/src/gl/context.js @@ -67,7 +67,6 @@ class Context { extTextureFilterAnisotropic: any; extTextureFilterAnisotropicMax: any; extTextureHalfFloat: any; - extRenderToTextureHalfFloat: any; extStandardDerivatives: any; extDebugRendererInfo: any; extTimerQuery: any; @@ -141,7 +140,8 @@ class Context { if (!isWebGL2) this.extTextureHalfFloat = gl.getExtension('OES_texture_half_float'); if (isWebGL2 || (this.extTextureHalfFloat && gl.getExtension('OES_texture_half_float_linear'))) { - this.extRenderToTextureHalfFloat = gl.getExtension('EXT_color_buffer_half_float'); + gl.getExtension('EXT_color_buffer_half_float'); + gl.getExtension('EXT_color_buffer_float'); } this.extStandardDerivatives = isWebGL2 || gl.getExtension('OES_standard_derivatives'); diff --git a/src/render/draw_heatmap.js b/src/render/draw_heatmap.js index fc5178599f4..1be2ff19fb5 100644 --- a/src/render/draw_heatmap.js +++ b/src/render/draw_heatmap.js @@ -123,9 +123,10 @@ function bindTextureToFramebuffer(context: Context, painter: Painter, texture: ? // Use the higher precision half-float texture where available (producing much smoother looking heatmaps); // Otherwise, fall back to a low precision texture /* $FlowFixMe[prop-missing] WebGL2 */ - const type = context.extRenderToTextureHalfFloat ? (context.isWebGL2 ? gl.HALF_FLOAT : context.extTextureHalfFloat.HALF_FLOAT_OES) : gl.UNSIGNED_BYTE; + const type = context.isWebGL2 ? gl.HALF_FLOAT : context.extTextureHalfFloat.HALF_FLOAT_OES; /* $FlowFixMe[prop-missing] WebGL2 */ - gl.texImage2D(gl.TEXTURE_2D, 0, (context.isWebGL2 && context.extRenderToTextureHalfFloat) ? gl.RGBA16F : gl.RGBA, width, height, 0, gl.RGBA, type, null); + const format = context.isWebGL2 ? gl.RGBA16F : gl.RGBA; + gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, gl.RGBA, type, null); fbo.colorAttachment.set(texture); } diff --git a/test/integration/render-tests/fog/2d/heatmap/style.json b/test/integration/render-tests/fog/2d/heatmap/style.json index 4a84860c2eb..92c7a0a7463 100644 --- a/test/integration/render-tests/fog/2d/heatmap/style.json +++ b/test/integration/render-tests/fog/2d/heatmap/style.json @@ -3,8 +3,7 @@ "metadata": { "test": { "height": 256, - "width": 256, - "allowed": 0.00265 + "width": 256 } }, "center": [ diff --git a/test/integration/render-tests/heatmap-color/default/style.json b/test/integration/render-tests/heatmap-color/default/style.json index 6845d1816a1..f41200873b9 100644 --- a/test/integration/render-tests/heatmap-color/default/style.json +++ b/test/integration/render-tests/heatmap-color/default/style.json @@ -4,7 +4,6 @@ "test": { "height": 64, "width": 256, - "allowed": 0.0073, "description": "Contains two expected images (for ubyte-based rendering and half-float-based); one of them should pass depending on platform." } }, diff --git a/test/integration/render-tests/heatmap-color/expression/style.json b/test/integration/render-tests/heatmap-color/expression/style.json index 37c8d756a29..9beaa0dff6e 100644 --- a/test/integration/render-tests/heatmap-color/expression/style.json +++ b/test/integration/render-tests/heatmap-color/expression/style.json @@ -4,7 +4,6 @@ "test": { "height": 64, "width": 256, - "allowed": 0.0073, "description": "Contains two expected images (for ubyte-based rendering and half-float-based); one of them should pass depending on platform." } }, diff --git a/test/integration/render-tests/heatmap-intensity/default/style.json b/test/integration/render-tests/heatmap-intensity/default/style.json index 9c9303ccad9..c7a936dad49 100644 --- a/test/integration/render-tests/heatmap-intensity/default/style.json +++ b/test/integration/render-tests/heatmap-intensity/default/style.json @@ -4,7 +4,6 @@ "test": { "height": 128, "width": 256, - "allowed": 0.00593, "description": "Contains two expected images (for ubyte-based rendering and half-float-based); one of them should pass depending on platform." } }, diff --git a/test/integration/render-tests/heatmap-intensity/function/style.json b/test/integration/render-tests/heatmap-intensity/function/style.json index 4f0a78020aa..2492d147287 100644 --- a/test/integration/render-tests/heatmap-intensity/function/style.json +++ b/test/integration/render-tests/heatmap-intensity/function/style.json @@ -4,7 +4,6 @@ "test": { "height": 128, "width": 256, - "allowed": 0.00263, "description": "Contains two expected images (for ubyte-based rendering and half-float-based); one of them should pass depending on platform." } }, diff --git a/test/integration/render-tests/heatmap-intensity/literal/style.json b/test/integration/render-tests/heatmap-intensity/literal/style.json index 12d40e10a61..f1be28bf29b 100644 --- a/test/integration/render-tests/heatmap-intensity/literal/style.json +++ b/test/integration/render-tests/heatmap-intensity/literal/style.json @@ -4,7 +4,6 @@ "test": { "height": 128, "width": 256, - "allowed": 0.0027, "description": "Contains two expected images (for ubyte-based rendering and half-float-based); one of them should pass depending on platform." } }, diff --git a/test/integration/render-tests/heatmap-opacity/default/style.json b/test/integration/render-tests/heatmap-opacity/default/style.json index a375d1d8960..4b4c3fb0711 100644 --- a/test/integration/render-tests/heatmap-opacity/default/style.json +++ b/test/integration/render-tests/heatmap-opacity/default/style.json @@ -4,7 +4,6 @@ "test": { "height": 32, "width": 128, - "allowed": 0.0044, "description": "Contains two expected images (for ubyte-based rendering and half-float-based); one of them should pass depending on platform." } }, diff --git a/test/integration/render-tests/heatmap-radius/default/style.json b/test/integration/render-tests/heatmap-radius/default/style.json index 9c9303ccad9..c7a936dad49 100644 --- a/test/integration/render-tests/heatmap-radius/default/style.json +++ b/test/integration/render-tests/heatmap-radius/default/style.json @@ -4,7 +4,6 @@ "test": { "height": 128, "width": 256, - "allowed": 0.00593, "description": "Contains two expected images (for ubyte-based rendering and half-float-based); one of them should pass depending on platform." } }, diff --git a/test/integration/render-tests/heatmap-radius/function/style.json b/test/integration/render-tests/heatmap-radius/function/style.json index 1525da02f87..5ad88e9c009 100644 --- a/test/integration/render-tests/heatmap-radius/function/style.json +++ b/test/integration/render-tests/heatmap-radius/function/style.json @@ -4,7 +4,6 @@ "test": { "height": 128, "width": 256, - "allowed": 0.01429, "description": "Contains two expected images (for ubyte-based rendering and half-float-based); one of them should pass depending on platform." } }, diff --git a/test/integration/render-tests/heatmap-radius/literal/style.json b/test/integration/render-tests/heatmap-radius/literal/style.json index 466ebf0edbc..7e092f0d72d 100644 --- a/test/integration/render-tests/heatmap-radius/literal/style.json +++ b/test/integration/render-tests/heatmap-radius/literal/style.json @@ -4,7 +4,6 @@ "test": { "height": 128, "width": 256, - "allowed": 0.01164, "description": "Contains two expected images (for ubyte-based rendering and half-float-based); one of them should pass depending on platform." } }, diff --git a/test/integration/render-tests/heatmap-radius/pitch30/style.json b/test/integration/render-tests/heatmap-radius/pitch30/style.json index b1d3e453f28..ae024a3ac1e 100644 --- a/test/integration/render-tests/heatmap-radius/pitch30/style.json +++ b/test/integration/render-tests/heatmap-radius/pitch30/style.json @@ -4,7 +4,6 @@ "test": { "height": 128, "width": 256, - "allowed": 0.02394, "description": "Contains two expected images (for ubyte-based rendering and half-float-based); one of them should pass depending on platform." } }, diff --git a/test/integration/render-tests/heatmap-weight/default/style.json b/test/integration/render-tests/heatmap-weight/default/style.json index 9c9303ccad9..c7a936dad49 100644 --- a/test/integration/render-tests/heatmap-weight/default/style.json +++ b/test/integration/render-tests/heatmap-weight/default/style.json @@ -4,7 +4,6 @@ "test": { "height": 128, "width": 256, - "allowed": 0.00593, "description": "Contains two expected images (for ubyte-based rendering and half-float-based); one of them should pass depending on platform." } }, diff --git a/test/integration/render-tests/heatmap-weight/identity-property-function/style.json b/test/integration/render-tests/heatmap-weight/identity-property-function/style.json index c7eea307ffb..52dd5348db5 100644 --- a/test/integration/render-tests/heatmap-weight/identity-property-function/style.json +++ b/test/integration/render-tests/heatmap-weight/identity-property-function/style.json @@ -4,7 +4,6 @@ "test": { "height": 128, "width": 256, - "allowed": 0.00627, "description": "Contains two expected images (for ubyte-based rendering and half-float-based); one of them should pass depending on platform." } }, diff --git a/test/integration/render-tests/heatmap-weight/literal/style.json b/test/integration/render-tests/heatmap-weight/literal/style.json index 71b6af366ea..956e52a58ba 100644 --- a/test/integration/render-tests/heatmap-weight/literal/style.json +++ b/test/integration/render-tests/heatmap-weight/literal/style.json @@ -4,7 +4,6 @@ "test": { "height": 128, "width": 256, - "allowed": 0.0027, "description": "Contains two expected images (for ubyte-based rendering and half-float-based); one of them should pass depending on platform." } },