mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 22:28:32 +09:00
[Fix] (MG_Impl/GLImpl, MG_State/GLState): reject unlinked empty programs [skip ci]
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user