mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +09:00
[Fix] (MG_Impl/GLImpl, MG_Backend): fix OpenGL 3.1 piglit cases
This commit is contained in:
@@ -608,6 +608,9 @@ namespace MobileGL {
|
||||
if (auto value = ParseAttribValue(attribList, EGL_CONTEXT_MINOR_VERSION); value) {
|
||||
contextObject.MinorVersion = *value;
|
||||
}
|
||||
if (auto value = ParseAttribValue(attribList, EGL_CONTEXT_OPENGL_PROFILE_MASK); value) {
|
||||
contextObject.OpenGLProfileMask = *value;
|
||||
}
|
||||
|
||||
const auto context = EncodeHandle<EGLContextHandle>(m_nextContextHandle++);
|
||||
m_contexts[context] = contextObject;
|
||||
@@ -691,6 +694,18 @@ namespace MobileGL {
|
||||
return ctx && ctx->Display == display;
|
||||
}
|
||||
|
||||
Bool EGLContext::IsCurrentContextOpenGLCoreProfile() const {
|
||||
const std::lock_guard<std::recursive_mutex> lock(m_mutex);
|
||||
auto currentIt = m_threadCurrents.find(CurrentThreadKey());
|
||||
if (currentIt == m_threadCurrents.end()) {
|
||||
return false;
|
||||
}
|
||||
const auto* ctx = TryGetContext(currentIt->second.Context);
|
||||
return ctx && ctx->ClientAPI == EGL_OPENGL_API &&
|
||||
((ctx->OpenGLProfileMask & EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT) ||
|
||||
ctx->MajorVersion > 3 || (ctx->MajorVersion == 3 && ctx->MinorVersion >= 1));
|
||||
}
|
||||
|
||||
EGLContext::EGLSurfaceHandle EGLContext::CreateWindowSurface(EGLDisplayHandle display,
|
||||
EGLConfigHandle config,
|
||||
NativeWindowType window,
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace MobileGL {
|
||||
EGLint* value) const;
|
||||
Bool ValidateContext(EGLContextHandle context) const;
|
||||
Bool ValidateContextOnDisplay(EGLDisplayHandle display, EGLContextHandle context) const;
|
||||
Bool IsCurrentContextOpenGLCoreProfile() const;
|
||||
|
||||
// Surface
|
||||
EGLSurfaceHandle CreateWindowSurface(EGLDisplayHandle display, EGLConfigHandle config,
|
||||
@@ -158,6 +159,7 @@ namespace MobileGL {
|
||||
EGLint ClientVersion = 1;
|
||||
EGLint MajorVersion = 1;
|
||||
EGLint MinorVersion = 0;
|
||||
EGLint OpenGLProfileMask = 0;
|
||||
};
|
||||
|
||||
struct SurfaceObject {
|
||||
|
||||
Reference in New Issue
Block a user