From ac70ee558bd00c83eb0a23998b6ffe7740f2012a Mon Sep 17 00:00:00 2001 From: PP Date: Thu, 14 Jan 2021 14:06:51 +0800 Subject: [PATCH] ban VAO on some runtime platforms (#8132) * optimize VAO on runtime update update * fix ESLint --- cocos/core/gfx/webgl/webgl-device.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cocos/core/gfx/webgl/webgl-device.ts b/cocos/core/gfx/webgl/webgl-device.ts index dd637af29f..febf20ec49 100644 --- a/cocos/core/gfx/webgl/webgl-device.ts +++ b/cocos/core/gfx/webgl/webgl-device.ts @@ -23,7 +23,7 @@ THE SOFTWARE. */ -import { ALIPAY, RUNTIME_BASED, BYTEDANCE, WECHAT, VIVO } from 'internal:constants'; +import { ALIPAY, RUNTIME_BASED, BYTEDANCE, WECHAT, LINKSURE, QTT, COCOSPLAY, HUAWEI } from 'internal:constants'; import { macro, warnID, warn } from '../../platform'; import { sys } from '../../platform/sys'; import { DescriptorSet, DescriptorSetInfo } from '../descriptor-set'; @@ -378,11 +378,9 @@ export class WebGLDevice extends Device { this._WEBGL_depth_texture = null; } - // earlier runtime VAO implementations doesn't work - if (RUNTIME_BASED && !VIVO) { - // @ts-expect-error - if (typeof loadRuntime !== 'function' || !loadRuntime() || typeof loadRuntime().getFeature !== 'function' || loadRuntime() - .getFeature('webgl.extensions.oes_vertex_array_object.revision') <= 0) { + if (RUNTIME_BASED) { + // VAO implementations doesn't work well on some runtime platforms + if (LINKSURE || QTT || COCOSPLAY || HUAWEI) { this._OES_vertex_array_object = null; } }