From e351ef9f412c0fbc07964173124a5b438ca89cfb Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Thu, 5 Feb 2026 12:20:42 +0800 Subject: [PATCH] [Fix] (MG_Impl/Texture): mark dirty only when pixel transfer happens --- MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp index 911fca93..ba104d13 100644 --- a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp +++ b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp @@ -714,9 +714,6 @@ namespace MobileGL { MGLOG_D("%s: Allocating %d bytes at mip %d", __func__, internalBytes, level); textureMipmapObject->AllocateStorage(textureUploadingTarget, level, {{width, height, 1}, internalBytes}); - MGLOG_D("%s: mark mip %d as dirty", __func__, level); - textureMipmapObject->MarkStorageDirty(textureUploadingTarget, level, true); - if (!originalPixels) { MGLOG_D("%s: No input pixel and no PBO bound, no pixel transfer", __func__); return; @@ -740,6 +737,9 @@ namespace MobileGL { } free(processedPixels); + + MGLOG_D("%s: mark mip %d as dirty", __func__, level); + textureMipmapObject->MarkStorageDirty(textureUploadingTarget, level, true); } void TexImage1D_State(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border,