[Fix] (MG_Backend/DirectGLES): patches for Photon (3rd patch)

This commit is contained in:
2026-01-10 21:59:03 +08:00
parent 3b807f6275
commit a051e51946
@@ -915,6 +915,15 @@ namespace MobileGL::MG_Backend::DirectGLES {
pos = source.find(findStr, pos);
}
findStr = "if (gtao.w == 0.0)";
replaceStr = "if (abs(gtao.w) <= 0.00001)";
pos = source.find(findStr);
while (pos != String::npos) {
MGLOG_D("Applying patch #3 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);