From 5c7457dbc6964b29c0a8167bf7f141ef60f8454f Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Thu, 29 Jan 2026 17:58:25 +0800 Subject: [PATCH] [Chore] (MG_Backend/DirectGLES, MG_Impl/Texture): more logging --- MobileGL/MG_Backend/DirectGLES/Managers.cpp | 4 ++-- MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/MobileGL/MG_Backend/DirectGLES/Managers.cpp b/MobileGL/MG_Backend/DirectGLES/Managers.cpp index 12a1b803..d49234fe 100644 --- a/MobileGL/MG_Backend/DirectGLES/Managers.cpp +++ b/MobileGL/MG_Backend/DirectGLES/Managers.cpp @@ -376,9 +376,9 @@ namespace MobileGL::MG_Backend::DirectGLES { auto* pData = (levelDirty && levelByteSize != 0) ? textureMipmapObject->MapMipmapData(uploadTarget, level) : nullptr; - MGLOG_D("%s: target: %s: syncing mip %d: %dx%dx%d, byteSize = %d, pData = %p", __func__, + MGLOG_D("%s: target: %s: syncing mip %d: %dx%dx%d, byteSize = %d, pData = %p, levelDirty = %s", __func__, MG_Util::ConvertTextureUploadTargetToString(uploadTarget).c_str(), level, - levelTexelSize.x(), levelTexelSize.y(), levelTexelSize.z(), levelByteSize, pData); + levelTexelSize.x(), levelTexelSize.y(), levelTexelSize.z(), levelByteSize, pData, levelDirty ? "true" : "false"); errorLopper.Clear(); MG_External::GLES::glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); diff --git a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp index 7f8ae5c0..6b9604e1 100644 --- a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp +++ b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp @@ -709,8 +709,11 @@ namespace MobileGL { "Texture object here should always be an object with mipmap"); auto textureMipmapObject = static_cast(textureObject.get()); + MGLOG_D("%s: Allocating %d bytes at mip %d", __func__, internalBytes, level); + // Allocate in TextureObject textureMipmapObject->AllocateStorage(textureUploadingTarget, level, {{width, height, 1}, internalBytes}); + textureMipmapObject->MarkStorageDirty(textureUploadingTarget, level, true); if (!originalPixels) { MGLOG_D("%s: No input pixel and no PBO bound, no pixel transfer", __func__); @@ -734,8 +737,6 @@ namespace MobileGL { textureMipmapObject->UpdateMipmapSubData(textureUploadingTarget, level, texelInput); } - textureMipmapObject->MarkStorageDirty(textureUploadingTarget, level, true); - free(processedPixels); }