mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 22:28:32 +09:00
[Feat|Refactor] (MG_Backend|MG_Impl): Implement BackendObject, replacing previous methods.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user