[Fix]: fix glmark2 crash

- deal with legacy GLSL syntax (attribute/varying/gl_FragColor/texture2D/etc.)
- implement glGet GL_SHADER_SOURCE_LENGTH, and make sure returns
  original shader source
- expose proper extensions (GL_ARB_depth_texture)
- support env var MOBILEGL_LOG_FILE_PATH
- unit tests to test against those changes
This commit is contained in:
2026-06-07 11:08:38 +08:00
parent ff41e59282
commit 19ada4b8f9
13 changed files with 439 additions and 48 deletions
+9 -3
View File
@@ -58,8 +58,14 @@ namespace MobileGL {
void InitFile() {
#if MOBILEGL_LOG_ENABLE_FILE
if (!s_logFile && MOBILEGL_LOG_FILE_PATH && *MOBILEGL_LOG_FILE_PATH) {
s_logFile = std::fopen(MOBILEGL_LOG_FILE_PATH, "w");
if (!s_logFile) {
const char* logPath = std::getenv("MOBILEGL_LOG_FILE_PATH");
if (!logPath || !*logPath) {
logPath = MOBILEGL_LOG_FILE_PATH;
}
if (logPath && *logPath) {
s_logFile = std::fopen(logPath, "w");
}
}
#endif
}
@@ -118,4 +124,4 @@ namespace MobileGL {
#endif
}
} // namespace MG_Util::Debug
} // namespace MobileGL
} // namespace MobileGL