[Fix] (replay-trace, MG_Impl/GLImpl): fix OpenRA Android retrace

This commit is contained in:
2026-07-02 16:08:43 +08:00
parent 4a3a226f27
commit 76f5a23b7f
4 changed files with 12 additions and 8 deletions
@@ -265,7 +265,8 @@ public:
attribs[index++] = EGL_CONTEXT_MINOR_VERSION_KHR;
attribs[index++] = profile.major >= 3 ? profile.minor : 3;
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;
@@ -396,9 +396,9 @@ bool ReadPpmRgbAsRgba(const std::string& path, RgbaImage& image, std::string& er
return true;
}
std::string SnapshotPathForCall(const Request& request) {
std::string SnapshotPathForCall(const Request& request, bool usePresentDump) {
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";
}
@@ -486,7 +486,7 @@ bool RunRetrace(const Request& request, bool usePresentDump, Result& result) {
return false;
}
std::string snapshotPath = SnapshotPathForCall(request);
std::string snapshotPath = SnapshotPathForCall(request, usePresentDump);
const std::string presentPath = request.outputDir + "/present.ppm";
const bool hasSnapshot = Exists(snapshotPath);
const bool hasPresentDump = usePresentDump && Exists(presentPath);