From b67a8d2e3a035f8229044ce569854a4c016de920 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sun, 11 Jan 2026 09:07:25 +0800 Subject: [PATCH] [Fix] (MG_Backend/DirectGLES): patches for Photon (4th patch) --- MobileGL/MG_Backend/DirectGLES/Managers.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MobileGL/MG_Backend/DirectGLES/Managers.cpp b/MobileGL/MG_Backend/DirectGLES/Managers.cpp index d5219c79..b3ffdc95 100644 --- a/MobileGL/MG_Backend/DirectGLES/Managers.cpp +++ b/MobileGL/MG_Backend/DirectGLES/Managers.cpp @@ -924,6 +924,15 @@ namespace MobileGL::MG_Backend::DirectGLES { pos = source.find(findStr, pos); } + findStr = "== 0.0"; + replaceStr = "<= 0.00001"; + pos = source.find(findStr); + while (pos != String::npos) { + MGLOG_D("Applying patch #4 to Photon..."); + source.replace(pos, findStr.length(), replaceStr); + pos = source.find(findStr, pos); + } + const char* sourceCStr = source.c_str(); MGLOG_D("Setting shader source for backend shader ID: %u\nsrc:\n%s", backendShaderId, sourceCStr); MG_External::GLES::glShaderSource(backendShaderId, 1, &sourceCStr, nullptr);