mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
Fix the rendering exception of the RenderTexture in the TikTok mini-game. (#17559)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user