From 8c00ae1d3824a0a3b931be362ee089f259758abc Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Tue, 12 May 2026 16:33:30 +0800 Subject: [PATCH] [Fix] (MG_Impl/GL_Texture): don't actually allocate large proxy texture to avoid large allocation makes some devices to crash --- MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp index 282af796..b636b784 100644 --- a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp +++ b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp @@ -685,8 +685,13 @@ namespace MobileGL::MG_Impl::GLImpl { auto textureMipmapObject = static_cast(textureObject.get()); // Allocate in TextureObject - MGLOG_D("%s: Allocating %d bytes at mip %d", __func__, internalBytes, level); - textureMipmapObject->AllocateStorage(textureUploadTarget, level, {{width, height, 1}, internalBytes}); + if (isProxy) { + MGLOG_D("%s: isProxy = true, not allocating", __func__); + } else { + MGLOG_D("%s: Allocating %d bytes at mip %d", __func__, internalBytes, level); + textureMipmapObject->AllocateStorage(textureUploadTarget, level, + {{width, height, 1}, internalBytes}); + } if (!originalPixels) { MGLOG_D("%s: No input pixel and no PBO bound, no pixel transfer", __func__);