[Feat|Refactor] (MG_Backend|MG_Impl): Implement BackendObject, replacing previous methods.

This commit is contained in:
BZLZHH
2026-02-18 10:36:56 +08:00
parent fe89dc82dc
commit 8413874e82
52 changed files with 5546 additions and 5863 deletions
+14 -2
View File
@@ -477,7 +477,19 @@ namespace MobileGL {
auto programObject = TryToGetProgramObject(program);
if (!programObject) return;
MGLOG_D("%s: linking program %d", __func__, program);
programObject->Link(!MG_Config::RendererInfoPtr->BackendCapability.AllowVSOnlyPrograms);
static Bool allowVSOnlyPrograms;
static Bool initialized = false;
if (!initialized) {
const auto& activeBackendObject = MG_Backend::pActiveBackendObject;
if (!activeBackendObject) {
MGLOG_E("activeBackendObject is not initialized!");
return;
}
const auto& rendererInfo = activeBackendObject->GetRendererInfo();
allowVSOnlyPrograms = (Int)rendererInfo.StaticBackendCapability.AllowVSOnlyPrograms;
}
programObject->Link(!allowVSOnlyPrograms);
}
void ShaderSource_State(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length) {
@@ -1160,4 +1172,4 @@ namespace MobileGL {
ValidateProgram_State(program);
}
} // namespace MG_Impl::GLImpl
} // namespace MobileGL
} // namespace MobileGL