diff --git a/MobileGL/MG_Backend/DirectGLES/Managers.cpp b/MobileGL/MG_Backend/DirectGLES/Managers.cpp index 1d8afb28..12a1b803 100644 --- a/MobileGL/MG_Backend/DirectGLES/Managers.cpp +++ b/MobileGL/MG_Backend/DirectGLES/Managers.cpp @@ -328,7 +328,7 @@ namespace MobileGL::MG_Backend::DirectGLES { // 4. Mipmap levels changed if (!stateTextureObject->IsComplete()) { - MGLOG_D("Texture object with ID: %u is not complete, skipping sync.", m_backendTextureId); + MGLOG_D("Texture object with ID: %u is not complete, skipping sync.", stateTextureObject->GetExternalIndex()); return; } diff --git a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp index 03dbcf9e..7f8ae5c0 100644 --- a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp +++ b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp @@ -88,6 +88,7 @@ namespace MobileGL { auto& bindingSlot = activeUnit.GetBindingSlot(textureTarget); auto textureObject = bindingSlot.GetBoundObject(); TextureInternalFormat textureInternalFormat = textureObject->GetFormat(); + MGLOG_D("%s: working on texture %d", __func__, textureObject->GetExternalIndex()); // ===================== Error Checking ============================== if (!TextureImpl::ValidateTextureObject(textureObject)) return; @@ -682,6 +683,8 @@ namespace MobileGL { const SizeT internalBpp = MG_Util::GetInternalBytesPerPixel(textureInternalFormat, texturePixelDataType); const SizeT internalBytes = width * height * internalBpp; + MGLOG_D("%s: working on texture %d", __func__, textureObject->GetExternalIndex()); + MGLOG_D("%s: texture object had internal format %s, new format %s", __func__, MG_Util::ConvertTextureInternalFormatToString(textureObject->GetFormat()).c_str(), MG_Util::ConvertTextureInternalFormatToString(textureInternalFormat).c_str()); diff --git a/MobileGL/MG_State/GLState/TextureState/TextureObject.cpp b/MobileGL/MG_State/GLState/TextureState/TextureObject.cpp index 641e4cba..2fbf712f 100644 --- a/MobileGL/MG_State/GLState/TextureState/TextureObject.cpp +++ b/MobileGL/MG_State/GLState/TextureState/TextureObject.cpp @@ -164,13 +164,24 @@ namespace MobileGL { SizeT levelCount = m_textureStorage.GetLevelCount(); if (levelCount == 0) { + MGLOG_D("%s: not complete because levelCount == 0", __func__); return false; } + // For some reason mojang decided to have 0x0 in last level mipmap + // Relaxing checks for that + bool hadZero = false; for (SizeT i = 0; i < levelCount; ++i) { const auto& levelSize = m_textureStorage.GetTexelSize(0, i); if (levelSize.x() <= 0 || levelSize.y() <= 0 || levelSize.z() <= 0) { - return false; + hadZero = true; + } else { + if (hadZero) { + // We're checking for "zero - not zero - zero" here + // "not zero - zero - zero" should pass this test + MGLOG_D("%s: not complete because 0x0 occurred, and is not last level mipmap", __func__); + return false; + } } } diff --git a/MobileGL/MG_Util/Texture/PixelStoreProcessor.cpp b/MobileGL/MG_Util/Texture/PixelStoreProcessor.cpp index 77b22188..7439e9ed 100644 --- a/MobileGL/MG_Util/Texture/PixelStoreProcessor.cpp +++ b/MobileGL/MG_Util/Texture/PixelStoreProcessor.cpp @@ -108,8 +108,8 @@ namespace MobileGL::MG_Util::PixelStoreProcessor { const Int copyHeight = height; const Int copyDepth = depth; - MGLOG_D("%s: start at: (%d, %d, %d), copy size: (%d, %d, %d), i/o row stride: (%d, %d)", __func__, - startX, startY, startZ, copyWidth, copyHeight, copyDepth, inputRowStride, outputRowStride); + MGLOG_D("%s: start at: (%d, %d, %d), copy size: (%d, %d, %d), i/o row stride: (%d, %dx%d)", __func__, + startX, startY, startZ, copyWidth, copyHeight, copyDepth, inputRowStride, width, pixelSize); if (copyWidth <= 0 || copyHeight <= 0 || copyDepth <= 0) { outSize = 0;