mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Fix] (replay-trace, MG_Impl/GLImpl): fix OpenRA Android retrace
This commit is contained in:
@@ -67,7 +67,7 @@ namespace MobileGL::MG_Impl::GLImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto& vao = MG_State::pGLContext->GetBoundVertexArray();
|
const auto& vao = MG_State::pGLContext->GetBoundVertexArray();
|
||||||
if (vao && vao->GetExternalIndex() == 0) {
|
if (MG_State::pEGLContext->IsCurrentContextOpenGLCoreProfile() && vao && vao->GetExternalIndex() == 0) {
|
||||||
MG_State::pGLContext->RecordError(
|
MG_State::pGLContext->RecordError(
|
||||||
ErrorCode::InvalidOperation,
|
ErrorCode::InvalidOperation,
|
||||||
MakeUnique<GenericErrorInfo>("MG_Impl/GLImpl", functionName,
|
MakeUnique<GenericErrorInfo>("MG_Impl/GLImpl", functionName,
|
||||||
|
|||||||
@@ -701,9 +701,12 @@ namespace MobileGL {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const auto* ctx = TryGetContext(currentIt->second.Context);
|
const auto* ctx = TryGetContext(currentIt->second.Context);
|
||||||
return ctx && ctx->ClientAPI == EGL_OPENGL_API &&
|
if (!ctx || ctx->ClientAPI != EGL_OPENGL_API ||
|
||||||
((ctx->OpenGLProfileMask & EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT) ||
|
(ctx->OpenGLProfileMask & EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT)) {
|
||||||
ctx->MajorVersion > 3 || (ctx->MajorVersion == 3 && ctx->MinorVersion >= 1));
|
return false;
|
||||||
|
}
|
||||||
|
return (ctx->OpenGLProfileMask & EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT) ||
|
||||||
|
ctx->MajorVersion > 3 || (ctx->MajorVersion == 3 && ctx->MinorVersion >= 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
EGLContext::EGLSurfaceHandle EGLContext::CreateWindowSurface(EGLDisplayHandle display,
|
EGLContext::EGLSurfaceHandle EGLContext::CreateWindowSurface(EGLDisplayHandle display,
|
||||||
|
|||||||
@@ -265,7 +265,8 @@ public:
|
|||||||
attribs[index++] = EGL_CONTEXT_MINOR_VERSION_KHR;
|
attribs[index++] = EGL_CONTEXT_MINOR_VERSION_KHR;
|
||||||
attribs[index++] = profile.major >= 3 ? profile.minor : 3;
|
attribs[index++] = profile.major >= 3 ? profile.minor : 3;
|
||||||
attribs[index++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
|
attribs[index++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
|
||||||
attribs[index++] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
|
attribs[index++] = profile.core ? EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR
|
||||||
|
: EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR;
|
||||||
}
|
}
|
||||||
attribs[index++] = EGL_NONE;
|
attribs[index++] = EGL_NONE;
|
||||||
|
|
||||||
|
|||||||
@@ -396,9 +396,9 @@ bool ReadPpmRgbAsRgba(const std::string& path, RgbaImage& image, std::string& er
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string SnapshotPathForCall(const Request& request) {
|
std::string SnapshotPathForCall(const Request& request, bool usePresentDump) {
|
||||||
char call[16];
|
char call[16];
|
||||||
snprintf(call, sizeof(call), "%010lld", request.targetCall);
|
snprintf(call, sizeof(call), "%010lld", usePresentDump ? request.targetCall + 1 : request.targetCall);
|
||||||
return request.outputDir + "/actual." + call + ".png";
|
return request.outputDir + "/actual." + call + ".png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -486,7 +486,7 @@ bool RunRetrace(const Request& request, bool usePresentDump, Result& result) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string snapshotPath = SnapshotPathForCall(request);
|
std::string snapshotPath = SnapshotPathForCall(request, usePresentDump);
|
||||||
const std::string presentPath = request.outputDir + "/present.ppm";
|
const std::string presentPath = request.outputDir + "/present.ppm";
|
||||||
const bool hasSnapshot = Exists(snapshotPath);
|
const bool hasSnapshot = Exists(snapshotPath);
|
||||||
const bool hasPresentDump = usePresentDump && Exists(presentPath);
|
const bool hasPresentDump = usePresentDump && Exists(presentPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user