From a3df044f33a17ad0debfbc31ef669e0275c65415 Mon Sep 17 00:00:00 2001 From: GengineJS <476393671@qq.com> Date: Tue, 20 Aug 2024 10:00:38 +0800 Subject: [PATCH] Fix the rendering exception of the RenderTexture in the TikTok mini-game. (#17559) --- cocos/gfx/webgl/webgl-commands.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cocos/gfx/webgl/webgl-commands.ts b/cocos/gfx/webgl/webgl-commands.ts index 4d7955cd94..a67933cab0 100644 --- a/cocos/gfx/webgl/webgl-commands.ts +++ b/cocos/gfx/webgl/webgl-commands.ts @@ -22,6 +22,7 @@ THE SOFTWARE. */ +import { BYTEDANCE } from 'internal:constants'; import { debugID, error, errorID, CachedArray, cclegacy, assertID } from '../../core'; import { WebGLCommandAllocator } from './webgl-command-allocator'; import { WebGLEXT } from './webgl-define'; @@ -854,8 +855,9 @@ export function WebGLCmdFuncCreateTexture (device: WebGLDevice, gpuTexture: IWeb if (maxSize > device.capabilities.maxTextureSize) { errorID(9100, maxSize, device.capabilities.maxTextureSize); } - - if (!device.textureExclusive[gpuTexture.format] && (!device.extensions.WEBGL_depth_texture && FormatInfos[gpuTexture.format].hasDepth)) { + // TODO: The system bug in the TikTok mini-game; once they fix it, a rollback will be necessary. + if (!device.textureExclusive[gpuTexture.format] + && ((!device.extensions.WEBGL_depth_texture || BYTEDANCE) && FormatInfos[gpuTexture.format].hasDepth)) { gpuTexture.glInternalFmt = GFXFormatToWebGLInternalFormat(gpuTexture.format, gl); gpuTexture.glRenderbuffer = gl.createRenderbuffer(); if (gpuTexture.size > 0) {