From 960e2c203fa8737c42951d2549cd9872c8275ecb Mon Sep 17 00:00:00 2001 From: Yun Hsiao Wu Date: Sun, 12 Jan 2020 14:43:47 +0800 Subject: [PATCH] hack depth texture detection for alipay (#6086) --- cocos/core/gfx/webgl/webgl-device.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cocos/core/gfx/webgl/webgl-device.ts b/cocos/core/gfx/webgl/webgl-device.ts index 5a16c00bbe..9ad1aff86d 100644 --- a/cocos/core/gfx/webgl/webgl-device.ts +++ b/cocos/core/gfx/webgl/webgl-device.ts @@ -257,6 +257,10 @@ export class WebGLGFXDevice extends GFXDevice { this._depthBits = gl.getParameter(gl.DEPTH_BITS); this._stencilBits = gl.getParameter(gl.STENCIL_BITS); + if (CC_ALIPAY) { + this._depthBits = 24; + } + this._devicePixelRatio = info.devicePixelRatio || 1.0; this._width = this._canvas.width; this._height = this._canvas.height; @@ -314,6 +318,10 @@ export class WebGLGFXDevice extends GFXDevice { this._OES_element_index_uint = this.getExtension('OES_element_index_uint'); this._ANGLE_instanced_arrays = this.getExtension('ANGLE_instanced_arrays'); + if (CC_ALIPAY) { + this._WEBGL_depth_texture = { UNSIGNED_INT_24_8_WEBGL: 0x84FA }; + } + this._features.fill(false); if (this._WEBGL_color_buffer_float) {