[Fix] (MG_Impl/GLImpl, MG_Backend): fix OpenGL 3.1 piglit cases

This commit is contained in:
2026-07-02 10:34:17 +08:00
parent 233277d94b
commit fabae2465b
7 changed files with 52 additions and 2 deletions
@@ -9,6 +9,7 @@
#include "GL_Drawing.h"
#include <Config.h>
#include <MG_State/GLState/Core.h>
#include <MG_State/EGLState/Core.h>
#include <MG_Backend/BackendObjects.h>
namespace MobileGL::MG_Impl::GLImpl {
@@ -65,6 +66,15 @@ namespace MobileGL::MG_Impl::GLImpl {
return false;
}
const auto& vao = MG_State::pGLContext->GetBoundVertexArray();
if (MG_State::pEGLContext->IsCurrentContextOpenGLCoreProfile() && vao && vao->GetExternalIndex() == 0) {
MG_State::pGLContext->RecordError(
ErrorCode::InvalidOperation,
MakeUnique<GenericErrorInfo>("MG_Impl/GLImpl", functionName,
"Default vertex array object cannot be used for drawing in core profile."));
return false;
}
return true;
}