[Fix] (MG_Impl/GLImpl, MG_State/GLState): reject unlinked empty programs [skip ci]

This commit is contained in:
2026-07-02 14:37:29 +08:00
parent bc2db26e07
commit ced7f28898
2 changed files with 12 additions and 0 deletions
@@ -624,6 +624,13 @@ namespace MobileGL::MG_Impl::GLImpl {
auto& programObject = TryToGetProgramObject(program);
if (!programObject) return;
if (!programObject->GetLinkStatus()) {
MG_State::pGLContext->RecordError(
ErrorCode::InvalidOperation,
MakeUnique<GenericErrorInfo>("MG_Impl/GLImpl", __func__,
"program " + std::to_string(program) + " is not linked."));
return;
}
MG_State::pGLContext->UseProgram(program);
}