[Fix] (MG_Impl/GLImpl, MG_State/GLState): fix frag data location queries [skip ci]

This commit is contained in:
2026-07-02 16:20:43 +08:00
parent 76f5a23b7f
commit b9de562491
5 changed files with 46 additions and 2 deletions
@@ -1200,6 +1200,19 @@ namespace MobileGL::MG_Impl::GLImpl {
std::to_string(program) + " is not the name of a program object."));
return -1;
}
if (name == nullptr) {
MG_State::pGLContext->RecordError(
ErrorCode::InvalidValue,
MakeUnique<GenericErrorInfo>("MG_Impl/GLImpl", __func__, "name cannot be null."));
return -1;
}
if (!programObject->GetLinkStatus()) {
MG_State::pGLContext->RecordError(
ErrorCode::InvalidOperation,
MakeUnique<GenericErrorInfo>("MG_Impl/GLImpl", __func__,
std::to_string(program) + " has not been linked successfully."));
return -1;
}
return programObject->GetFragmentDataLocation(name);
}